How to add grid lines on top of a heatmap in Makie?

The grid lines are moved backwards in z a bit so the normal plots are on top of them. You can move the heatmap back so it’s behind them. (Or move them forward)

f, ax, hm = heatmap(randn(100, 100), colormap = :Blues, colorrange = (-2, 8),
  axis = (;
    aspect = DataAspect(),
    xgridcolor = :black,
    ygridcolor = :black,
    xgridwidth = 2,
    ygridwidth = 2,
    xminorgridcolor = :black,
    yminorgridcolor = :black,
    xminorgridvisible = true,
    yminorgridvisible = true,
    xminorticks = IntervalsBetween(5),
    yminorticks = IntervalsBetween(5),
  ))
translate!(hm, 0, 0, -100)
f

4 Likes