ScottPlot.NET
GitHub Repo stars

Function Limit X

A function can be limited to a range of X values.

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

var func = new Func<double, double>((x) => Math.Sin(x) * Math.Sin(x / 2));

var f = myPlot.Add.Function(func);
f.MinX = -3;
f.MaxX = 3;

myPlot.Axes.SetLimits(-5, 5, -.2, 1.0);

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

Edit on GitHub