Skip to content

Axes: need a way to Remove() axes from multi-axis plots #3288

@swharden

Description

@swharden

Felix in the Discord (#1966) noted there is no way to remove additional axes once added

/// <summary>
/// Horizontal axes
/// </summary>
internal List<IXAxis> XAxes { get; } = new();
/// <summary>
/// Vertical axes
/// </summary>
internal List<IYAxis> YAxes { get; } = new();

/// <summary>
/// Remove all axes that lie on the given edge.
/// </summary>
public void Remove(Edge edge)
{
foreach (IAxis axis in GetAxes(edge).ToArray())
{
if (axis is IXAxis xAxis)
Plot.Axes.XAxes.Remove(xAxis);
if (axis is IYAxis yAxis)
Plot.Axes.YAxes.Remove(yAxis);
}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions