put labels inside colorbar
조회 수: 13 (최근 30일)
이전 댓글 표시
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
답변 (2개)
Scott MacKenzie
2021년 6월 14일
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
fransec
2021년 6월 15일
댓글 수: 1
Scott MacKenzie
2021년 6월 15일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!