Skip to content

Plot.Clear() does not clear axis boundary view limits #2264

@vietanhbui

Description

@vietanhbui

Issue: AxisAuto() after ResetAxisLimits() not working properly

var plt = formsPlot.Plot;

// create sample data
double[] values1 = { 26, 20, 23, 7, 16 };

// add a bar graph to the plot
plt.AddBar(values1);

formsPlot.Plot.SetOuterViewLimits(-0.5, 5, 0, 30);
formsPlot.Plot.SetAxisLimits(-0.5, 5, 0, 30);
formsPlot.Refresh();

// Test AxisAuto function
double[] values2 = { 136, 20, 23, 7, 16 };
plt.Clear();
plt.GetSettings().ResetAxisLimits();
plt.AddBar(values2);
formsPlot.Plot.AxisAuto();  // <= Want to fit data values2
formsPlot.Refresh();           // When I debug, formsPlot.Plot.YAxis.Dims.Max still value=30

System Details

  • ScottPlot Version: 4.1.52
  • Operating System: Windows 11
  • Application Type: WinForms
  • .NET Version: NET Framework 4.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGunexpected behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions