Remove Colorbar ticks

I’m using heatmap() in Plots.jl in the gr() backend and I want to remove the ticks and numbers that comes automatically with the colorbar. Is there a way to do that?

Assuming zmin is the minimum value of data in z, you could do

heatmap(x, y, z, colorbar_ticks=([zmin], [""]))

but someone else might have something more elegant.

This limitation of the gr() backend doesn’t seem to have been fixed yet.
With the pyplot() backend we have several options, including: colorbar_ticks=false.

Also, the previous suggestion didn’t work for me with gr().

If we cannot unplot it, we can perhaps hide it:

using Plots; gr()
x, y = 0:10, -5:5
p = heatmap(x, y, 10rand(11,11))
for yi in range(extrema(y)..., 20)
    annotate!(maximum(x)+ 1.93, yi, text("██", :white, 30))
end
p

Plots_gr_masking_colorbar_ticks

2 Likes