ScottPlot.NET
GitHub Repo stars

Axis Span Quickstart

Axis spans label a range of an axis. Vertical spans shade the full width of a vertical range, and horizontal spans shade the full height of a horizontal range.

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

myPlot.Add.Signal(Generate.Sin());
myPlot.Add.Signal(Generate.Cos());

var hSpan = myPlot.Add.HorizontalSpan(10, 20);
var vSpan = myPlot.Add.VerticalSpan(0.25, 0.75);

hSpan.Label.Text = "Horizontal Span";
vSpan.Label.Text = "Vertical Span";
myPlot.ShowLegend();

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

Edit on GitHub