How to move the colorbar label to top position of the bar?
Show older comments
I need to change the colorbar label to the position showed in the attached image.
C = [0 2 4 6; 8 10 12 14; 16 18 20 22];
clims = [4 18];
imagesc(C,clims)
e=colorbar;
e.Label.String = 'amp';

Accepted Answer
More Answers (1)
AB
on 14 Jul 2025
There seems to be a hidden Title property on the ColorBar object that might be a better way to accomplish this. Just do
h = colorbar;
h.Title.String = 'amp';
Note that h.Title will not appear until set.
Categories
Find more on White in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!