Hide colorbar axis and add top and bottom label in Plots.jl

Hi,

I am trying to plot a heatmap with a colorbar, but I want to hide the axis lines and tick numbers, and add labels on top and bottom of the colorbar.

I could achieve this,

heatmap(rand(10,10),color=:RdBu,colorbar_title="ColorBar")


but don’t know how to plot something like this

Can anyone help?

The pyplot() backend of Plots allows manual labeling of the color bar ticks:

using Measures, Plots; pyplot(dpi=300)
m = rand(10,10);  lm = extrema(m)
heatmap(data, c=:RdBu, margin=10mm, clims=lm, colorbar_ticks=(lm, ["sink","source"]))

1 Like