Open dylanfesta opened 3 months ago
Hm you're right I also see that in CairoMakie, but not in GLMakie. So that suggests there is no problem with the underlying heatmap data, but that the tile overlapping that CairoMakie does (to remove antialiasing fringes between heatmap cells) is buggy and we actually see the overlaps, which shouldn't happen. That's why the factor you find is variable, because it's in screen space and not data space.
I think we did this deliberately at some stage to prevent aliasing, but maybe the order in which the rectangles are plotted is incorrect, resulting in bad overdraw behavior.
You will probably find that the offset is exactly 1 pixel...
Until the bug is fixed, is there a way to know the exact offset value? Can I extract the length of the axis in pixels? I checked the documentation but I could not find an answer.
I was plotting some analytic curves on top of a heatmap using CairoMackie, and I found out that possibly all heatmaps are slightly misaligned with respect to the axis coordinates. This can be fixed by shifting the heatmap of a factor that I had to find by trial and error (and that might vary!). In the example below I generate heatmaps of random numbers, and then draw edges as vertical and horizontal lines. The contours are expected to match.
This is the plot I see.
When I zoom in, the left plot shows a clear misalignment between the heatmap edges and the lines in axis coordinates. In the right plot the misalignment is fixed by adding the
N/500
correction.I am using the latest version of Makie and the same problem appears consistently on Ubuntu 20.04 and Fedora 40 machines.