Setting the range of colormap

1 回表示 (過去 30 日間)
Deepa Maheshvare
Deepa Maheshvare 2020 年 1 月 20 日
コメント済み: Deepa Maheshvare 2020 年 1 月 20 日
I want to set the min and max range of colormap
I want to set the limits of colormap based on the mix and max of values stored in data
data = rand(10,10);
min = min(min(data))
max= max(max(data))
Any suggestions on how this can be done?

回答 (1 件)

Bhaskar R
Bhaskar R 2020 年 1 月 20 日
caxis([min(data(:)), max(data(:))]);
See more details
  3 件のコメント
Image Analyst
Image Analyst 2020 年 1 月 20 日
That's because you clear your figure with clf right at the start of the loop! That clears everything including what you set up with caxis(). Don't call clf.
Deepa Maheshvare
Deepa Maheshvare 2020 年 1 月 20 日
Thank you. I removed clf, even now the color assignd to values change in each iteration

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

カテゴリ

Help Center および File ExchangeBlue についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by