ScottPlot.NET
GitHub Repo stars

Line Height

Multiline labels have a default line height estimated from the typeface and font size, however line height may be manually defined by the user.

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

var label1 = myPlot.Add.Text($"line\nheight", 0, 0);
label1.LineSpacing = 0;
label1.FontColor = Colors.Red;

var label2 = myPlot.Add.Text($"can\nbe", 1, 0);
label2.LineSpacing = 10;
label2.FontColor = Colors.Orange;

var label3 = myPlot.Add.Text($"automatic\nor", 2, 0);
label3.LineSpacing = null;
label3.FontColor = Colors.Green;

var label4 = myPlot.Add.Text($"set\nmanually", 3, 0);
label4.LineSpacing = 15;
label4.FontColor = Colors.Blue;

myPlot.Axes.SetLimitsX(-.5, 4);

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

Edit on GitHub