Multiple Legends
Multiple legends may be added to a plot
ScottPlot.Plot myPlot = new();
for (int i = 1; i <= 5; i++)
{
double[] data = Generate.Sin(51, phase: .02 * i);
var sig = myPlot.Add.Signal(data);
sig.LegendText = $"Signal #{i}";
sig.LineWidth = 2;
}
// default legend
var leg1 = myPlot.ShowLegend();
leg1.Alignment = Alignment.LowerRight;
leg1.Orientation = Orientation.Vertical;
// additional legend
var leg2 = myPlot.Add.Legend();
leg2.Alignment = Alignment.UpperCenter;
leg2.Orientation = Orientation.Horizontal;
myPlot.SavePng("demo.png", 400, 300);
This recipe is one of many in the Legends category
