Grid in Heatmap

Hi, I’m working on a simple A-star viz and was wondering if it’s possible to plot a grid on a heatmap. My current heatmap on Makie looks like:

I want it to have grids, preferably a Major grid (every 5-10 ticks) and a Minor grid (every tick).


using Makie
using ColorSchemes, Colors

arr = zeros(Int, 100,100)
arr[35:55,30] .= 1
arr[90,95] = 3

cmap = ColorScheme([colorant"white", colorant"black", colorant"green"])

f = Figure()
ax = Axis(f[1,1], xminorticksvisible=true, xminorgridvisible=true, yminorticksvisible=true, yminorgridvisible=true,
        xticks=0:5:100, yticks=0:5:100, xminorticks=0:1:100, yminorticks=0:1:100)

hidedecorations!(ax, grid=false, minorgrid=false)
heatmap!(ax, arr, colormap=cmap)

If I don’t set the 1’s and 3 values (Only zeros array) I get something close to what I want:

You could try hm = heatmap!(ax... and then translate!(hm, 0, 0, -1000) or something like that, because the grid lines are behind the heatmap

That worked at -15, -1000 was too much. Thanks. But now that I think about it, there should be a way to to overlay one Axis on top of another.