How to change color of colorbar's lower minimum value?
조회 수: 11 (최근 30일)
이전 댓글 표시
How can I change the minimum value color on the color bar? I'm getting white color for the lower values.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/145742/image.png)
imagesc(x,y,value)
set(gca,'YDir','normal')
myColorMap = colormap;
myColorMap(1,:) = [1 1 1];
colormap(myColorMap);
colorbar;
ma=max(value);
mi=min(value);
댓글 수: 0
채택된 답변
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
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
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 Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!