필터 지우기
필터 지우기

How to change color of colorbar's lower minimum value?

조회 수: 11 (최근 30일)
Tunechi
Tunechi 2014년 10월 16일
댓글: Star Strider 2014년 10월 17일
How can I change the minimum value color on the color bar? I'm getting white color for the lower values.
imagesc(x,y,value)
set(gca,'YDir','normal')
myColorMap = colormap;
myColorMap(1,:) = [1 1 1];
colormap(myColorMap);
colorbar;
ma=max(value);
mi=min(value);

채택된 답변

Star Strider
Star Strider 2014년 10월 16일
You are getting a white color for the lower values because you defined:
myColorMap(1,:) = [1 1 1];
  댓글 수: 11
Image Analyst
Image Analyst 2014년 10월 17일
Why does your image have nan's in it anyway? What color do you want the nan's to appear as? I think an axes control might have a background or foreground color that appears if the pixels are nan's (so they mgiht be "transparent") but I'd have to check on that. I never deal with images that have nan's. Why do you have them?
Star Strider
Star Strider 2014년 10월 17일
Tunechi — My pleasure!
I A — That’s new. I didn’t know about imagesc until now. I used contourf in my example.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by