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 CenterFile Exchange에서 Blue에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by