GitHub Repo stars

AutoScale Axis Limits to Fit Data

The axis limits can be automatically adjusted to fit the data. Optional arguments allow users to define the amount of whitespace around the edges of the data.In older versions of ScottPlot this functionality was achieved by a method named AxisAuto().

This code sample is specific to ScottPlot 5 (details)
ScottPlot.Plot myPlot = new();


// set limits that do not fit the data
myPlot.Axes.SetLimits(-100, 150, -5, 5);

// reset limits to fit the data

myPlot.SavePng("demo.png", 400, 300);

Edit on GitHub