ScottPlot.NET
GitHub Repo stars

Right Axis Only

The default Y axis is the one on the left of the plot, but the right Y axis may be used instead.

ScottPlot.Plot myPlot = new();

// add a plottable to the plot
var sig = myPlot.Add.Signal(Generate.Sin());

// configure the plottable to use the right Y axis
sig.Axes.YAxis = myPlot.Axes.Right;

// configure the grid to display ticks from the right Y axis
myPlot.Grid.YAxis = myPlot.Axes.Right;

// style the right axis as desired
myPlot.Axes.Right.Label.Text = "Hello, Right Axis";
myPlot.Axes.Right.Label.FontSize = 18;

// it is recommended to remove tick generators from unused axes
myPlot.Axes.Left.RemoveTickGenerator();

// pass in the custom axis when calling SetLimits()
myPlot.Axes.SetLimitsY(bottom: -2, top: 2, yAxis: myPlot.Axes.Right);

myPlot.SavePng("demo.png", 400, 300);
This recipe is one of many in the Multiple Axes category