Skip to content

SP5: Heatmap vertical extent wrong when not square scaling #3416

@BrianAtZetica

Description

@BrianAtZetica

Issue: When a horizontal scaling is applied to a heatmap plot the vertical axes are offset form the true coordinates.

ScottPlot Version: SP5 (nuget v5.0.21github main fork)

Code Sample:

double[,] data = SampleData.MonaLisa();
var hm1 = myPlot.Add.Heatmap(data);
// MonaLisa is sized 65 x 100 pixels.
// With normal scaling, it's bottom left corner will plot at -0.5, -0.5. and its top right corner at 64.5, 99.5
myPlot.Axes.SetLimits(-1, 65, -1, 100);
myPlot.SavePng("MonaLisaSquareScaling.png", 650, 1000);
myPlot.Title("Square Scaling: Vertical Extent Should be 0 to 100");

// If we scale the horizontal extent (x100) the bottom left corner should be at -50, -0.5 and the top corner at 6450, 99.5
hm1.Extent = new(0, 6500, 0, 100);
myPlot.Axes.SetLimits(-60, 6460, -60, 160);
myPlot.SavePng("MonaLisa100xHorizontalScaling.png", 650, 1000);
myPlot.Title("100x Horizontal Scaling: Vertical Extent Should be 0 to 100");

MonaLisa100xHorizontalScaling

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions