put labels inside colorbar
2 views (last 30 days)
Show older comments
Hello everybody
I would like to write the labels of my colorbar inside the colorbar itself.
So, in other words, to put the numbers -0.4 -0.2 0 0.2 ecc...inside the colorbar (which has a colormap hot, high to right in the image):
Could anyone help me?
Thanks so much!
0 Comments
Answers (2)
Scott MacKenzie
on 14 Jun 2021
Just add tick labels to the colorbar:
plot(rand(1,5));
h = colorbar('northoutside');
h.TickLabels = { -.4 -.3 -.2 -.1 0 .1 .2 .3 .4};
0 Comments
fransec
on 15 Jun 2021
1 Comment
Scott MacKenzie
on 15 Jun 2021
Hmm, my misunderstanding. I don't think that's possible unless you put together some klugy glue-code that writes text directly in the figure window.
See Also
Categories
Find more on Colorbar 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!