put labels inside colorbar

2 ビュー (過去 30 日間)
fransec
fransec 2021 年 6 月 14 日
コメント済み: Scott MacKenzie 2021 年 6 月 15 日
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!

回答 (2 件)

Scott MacKenzie
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};

fransec
fransec 2021 年 6 月 15 日
Hei. Sorry, probably I didn't explain my issue properly....
I don't want jus to add tick labels (which are already present), but to move them inside the colorbar and not outside.
So I want to draw the number (0.2 0.4 ecc) in the colored field.
Do you know any tips or method about it?
thanks so much!
  1 件のコメント
Scott MacKenzie
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 ExchangeColorbar についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by