ScottPlot.NET
GitHub Repo stars

Marker

Marker Quickstart

Markers are symbols placed at a location in coordinate space. Their shape, size, and color can be customized.

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

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

myPlot.Add.Marker(25, .5);
myPlot.Add.Marker(35, .6);
myPlot.Add.Marker(45, .7);

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

Marker Shapes

Many marker shapes are available.

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

ScottPlot.Colormaps.Turbo colormap = new();

for (int i = 0; i < 100; i++)
{
    MarkerShape shape = Generate.RandomMarkerShape();
    Coordinates location = Generate.RandomCoordinates();
    float size = Generate.RandomInteger(5, 10);
    Color color = Generate.RandomColor(colormap);

    myPlot.Add.Marker(location, shape, size, color);
}

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

Marker Legend

Markers with labels appear in the legend.

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

var sin = myPlot.Add.Signal(Generate.Sin());
sin.Label = "Sine";

var cos = myPlot.Add.Signal(Generate.Cos());
cos.Label = "Cosine";

var marker = myPlot.Add.Marker(25, .5);
marker.Label = "Marker";
myPlot.ShowLegend();

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

Many Markers

Collections of markers that are all styled the same may be added to the plot

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

double[] xs = Generate.Consecutive(51);
double[] sin = Generate.Sin(51);
double[] cos = Generate.Cos(51);

myPlot.Add.Markers(xs, sin, MarkerShape.OpenCircle, 15, Colors.Green);
myPlot.Add.Markers(xs, cos, MarkerShape.FilledDiamond, 10, Colors.Magenta);

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