GitHub Repo stars

Image Marker

An ImageMarker can be placed on the plot to display an image centered at a location in coordinate space.

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


// An image can be loaded from a file or created dynamically
ScottPlot.Image image = SampleImages.ScottPlotLogo(48, 48);

Coordinates location1 = new(5, .5);
Coordinates location2 = new(25, .5);

myPlot.Add.ImageMarker(location1, image);
myPlot.Add.ImageMarker(location2, image, scale: 2);

var m1 = myPlot.Add.Marker(location1);
var m2 = myPlot.Add.Marker(location2);
m1.Color = Colors.Orange;
m2.Color = Colors.Orange;

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

Edit on GitHub