フィルターのクリア

colorbar tick decimal round

31 ビュー (過去 30 日間)
Hung Jr Chen
Hung Jr Chen 2016 年 5 月 2 日
コメント済み: hossein 2018 年 12 月 14 日
Hi,
I would like to round my colorbar values to 2 decimal places, is it possible?
Like in my figure, it has 4 dicimal places, 0.0372, I would like to display to 0.04 only.
I don't know how to do that :S
I try:
but failed.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 5 月 2 日
plot(1:10)
h=colorbar
t=get(h,'Limits');
T=linspace(t(1),t(2),5)
set(h,'Ticks',T)
TL=arrayfun(@(x) sprintf('%.2f',x),T,'un',0)
set(h,'TickLabels',TL)
  1 件のコメント
hossein
hossein 2018 年 12 月 14 日
Work 100% Perfect. Thanks. A life save ;)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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