Could I change the color of specific point?

조회 수: 3 (최근 30일)
BB
BB 2012년 11월 28일
Hi, all
I have a matrix 49x49,
It's contains 0~10000 value.
When I plot this matrix, use colorbar.
But the zero value point,I want to use white color to present this point.
How can I do?
Thanks.
  댓글 수: 3
BB
BB 2012년 11월 28일
Other color is use "colorbar" this command
only zero value use white
Jan
Jan 2012년 11월 28일
When you post the relevant part of your code, inserting modifications is much easier. Test data can usually created by RAND.

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

채택된 답변

Image Analyst
Image Analyst 2012년 11월 28일
Get the colormap, set 0 to white, then reapply it.
cm = colormap;
cm(0, :) = [255 255 255];
colormap(cm);
  댓글 수: 5
Image Analyst
Image Analyst 2012년 11월 28일
That's right. The values must be in the range 0-1, not 0-255 even though it's really 255. So try this:
cm(1, :) = [1 1 1];
BB
BB 2012년 11월 28일
ok,it's looks good. thank you~

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Color and Styling에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by