change the scale of colorbar

34 ビュー (過去 30 日間)
Zhihan Wu
Zhihan Wu 2022 年 8 月 8 日
コメント済み: Zhihan Wu 2022 年 8 月 13 日
I wanna change the scale of the color bar. of the image below to [0 0.02]
I tried many method, like shown below
image(x,y,D')
c = colorbar;
%c.Limits = [0 0.02]
%set(c,'ylim',[0 0.02])
but the outcome is like this. The colorbar become the same color. only the range changes instead of the scale. I want the colorbar to be different from 0 to 0.02. How should I do that? Thanks for answering!

採用された回答

Karim
Karim 2022 年 8 月 8 日
you can use the caxis command, simply add caxis( [0 0.02]) below the colorbar command.
figure
surf(rand(10,10))
c = colorbar;
caxis([0 0.2])
  3 件のコメント
Image Analyst
Image Analyst 2022 年 8 月 8 日
@Zhihan Wu attach D in a .mat file with the paperclip icon so we can help you further. Make it easy for us to help you and you'll get an answer faster.
save('answers.mat', 'D');
Zhihan Wu
Zhihan Wu 2022 年 8 月 13 日
I think my problem is solved. Thank you all!

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

その他の回答 (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