ScottPlot.NET
GitHub Repo stars

Legend Quickstart

Many plottables have a Label property that can be set so they appear in the legend.

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

var sig1 = myPlot.Add.Signal(Generate.Sin(51));
sig1.Label = "Sin";

var sig2 = myPlot.Add.Signal(Generate.Cos(51));
sig2.Label = "Cos";

myPlot.ShowLegend();

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

Edit on GitHub