ScottPlot.NET
GitHub Repo stars

Image Rectangle

An image can be drawn inside a rectangle defined in coordinate units.

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

// Images may be loaded from files or created dynamically
ScottPlot.Image img = ScottPlot.SampleImages.MonaLisa();

CoordinateRect rect = new(left: 0, right: img.Width, bottom: 0, top: img.Height);

myPlot.Add.ImageRect(img, rect);

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

Edit on GitHub