-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
Issue: When the user provides extents for a heatmap, they will be thinking about the first and last data value coordinate.
Currently this will be misinterpreted, with an off-by-one error on the maximum extent.
ScottPlot Version: SP5 (nuget 5.0.21 and main github branch)
In sample code belwo user has a 2 x 3 array of data. They will want the heatmap cell centres to be aligned on integer axes, so they set extents of 0,1,0,2
double[,] data = { { 1, 2 }, { 3, 4 } , { 5, 6 } };
var hm1 = WpfPlot1.Plot.Add.Heatmap(data);
hm1.CellAlignment = Alignment.MiddleCenter;
// User defines an X extent of 0 to 1 (intending the first column on 0 and the second column on 1).
// User defines an Y extent of 0 to 2 (intending the first row on 0 and last row on 2).
hm1.Extent = new(0, 1, 0, 2);
hm1.FlipRows = false;
hm1.FlipColumns = false;
WpfPlot1.Plot.Axes.SetLimits(-1.2, 2.2, -1.2, 3.2);
WpfPlot1.Plot.Title("Default Image Orientation");
hm1.Smooth = false;
WpfPlot1.Plot.SavePng("2x3 grid Default.png", 300, 400);Expected Output:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

