How can I display min and max in the colorbar?
古いコメントを表示
Hi,
I would like to display max and min value on my colorbar.
How can I do it?

In my plot it only displays 0.01, 0.02, 0.03...
I want to display max and min also on the colorbar.
Thanks.
3 件のコメント
Azzi Abdelmalek
2016 年 5 月 1 日
How did you get the plot?
Walter Roberson
2016 年 5 月 1 日
Are you using R2014a or earlier, or are you using R2015b or later?
Stephen23
2016 年 5 月 2 日
採用された回答
その他の回答 (1 件)
gwoo
2018 年 10 月 26 日
You can also do the following and keep the automatically selected tick marks.
hColorbar = colorbar;
set(hColorbar, 'Ticks', sort([hColorbar.Limits, hColorbar.Ticks]))
This simply adds the limits to the tick labels and sorts them in order so they don't error out.
If you want them to be the same display precision (digits shown) as the others, you can do the typical:
round(0.00532 * 1000) / 1000
Obviously change the 1000 to whatever value you need to get whatever digit you need to round off to the one's place value for the rounding function. The /1000 gets it back in the original units.
カテゴリ
ヘルプ センター および File Exchange で Colorbar についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

