Skip to content

Heatmap: fix vertical placement#3417

Merged
swharden merged 2 commits intoScottPlot:mainfrom
BrianAtZetica:HeatMapColorMap
Mar 14, 2024
Merged

Heatmap: fix vertical placement#3417
swharden merged 2 commits intoScottPlot:mainfrom
BrianAtZetica:HeatMapColorMap

Conversation

@BrianAtZetica
Copy link
Contributor

@BrianAtZetica BrianAtZetica commented Feb 26, 2024

This simple typo fix resolves issue #3416

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.Title("100x Horizontal Scaling: Vertical Extent Should be 0 to 100");
myPlot.SavePng("MonaLisa100xHorizontalScaling.png", 650, 1000);

MonaLisa100xHorizontalScaling

@swharden
Copy link
Member

Thanks @BrianAtZetica! I'll merge this in now and it will be in the next release. Great catch!

before after
MonaLisa100xHorizontalScaling MonaLisa100xHorizontalScaling

@swharden swharden linked an issue Mar 13, 2024 that may be closed by this pull request
@swharden swharden changed the title Bug fix to resolve #3416 Heatmap: fix vertical placement Mar 13, 2024
@swharden swharden merged commit 9d8cd79 into ScottPlot:main Mar 14, 2024
@swharden
Copy link
Member

Also I think I accidentally modified the changelog in another branch or something... but either way, it's there now. Thanks again! 273c253

* Heatmap: Improve vertical placement of scaled heatmaps (#3416, #3417) @BrianAtZetica

@BrianAtZetica BrianAtZetica deleted the HeatMapColorMap branch March 17, 2024 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SP5: Heatmap vertical extent wrong when not square scaling

2 participants