ScottPlot.NET
GitHub Repo stars

Heatmap Rectangle

Dimensions of a heatmap may be set by defining a rectangle that the heatmap will be rendered inside.

ScottPlot.Plot myPlot = new();

// create a heatmap of any size
double[,] data = {
    { 1, 2, 3 },
    { 4, 5, 6 },
    { 7, 8, 9 },
};

// add the heatmap to the plot
var hm = myPlot.Add.Heatmap(data);

// place the heatmap in a rectangle defined in coordinate space
hm.Rectangle = new CoordinateRect(-5, 5, -5, 5);

myPlot.SavePng("demo.png", 400, 300);
This recipe is one of many in the Heatmap category