In Plots.jl `heatmap`s, how do I set the colorbar ticks?

if I create a heatmap:

using Plots
heatmap(rand(5,5); clim = (0.0, 1.0))

How do I set the ticks on the colorbar? I.e. if I would have wanted it to be [0.0, 0.25, 0.5, 0.75, 1.0]?

Check the keyword colorbar_ticks and the Supported Attributes · Plots.
This is only supported by the pyplot() backend.

However, with any other backend, it is easy to create your own color bar and decorations by treating it as a heatmap in a neighboring subplot.
Check out this post.

1 Like

Thanks :slight_smile: