We can give x and y axes labels for the main axes. Is there any way to similarly give a color bar a label? Alternately, is there any way to append a unit to one or more colorbar ticks?
Like many axis objects, colorbar()
has a set_label()
method:
cbar = fig.colorbar(heatmap)
cbar.set_label('Label name',size=18)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With