Skip to content

SP5: initial scale in incorrect if plot contains plottables with 1D axis limits #3132

@swharden

Description

@swharden

I think the issue is here. The incoming value is not checked for NaN, and Min() and Max() of a NaN will always return NaN

/// <summary>
/// Expanded limits to include the given <paramref name="x"/>.
/// </summary>
public void ExpandX(double x)
{
Left = !double.IsNaN(Left) ? Math.Min(Left, x) : x;
Right = !double.IsNaN(Right) ? Math.Max(Right, x) : x;
}
/// <summary>
/// Expanded limits to include the given <paramref name="y"/>.
/// </summary>
public void ExpandY(double y)
{
Bottom = !double.IsNaN(Bottom) ? Math.Min(Bottom, y) : y;
Top = !double.IsNaN(Top) ? Math.Max(Top, y) : y;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions