Could I change the color of specific point?

1 vue (au cours des 30 derniers jours)
BB
BB le 28 Nov 2012
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 commentaires
BB
BB le 28 Nov 2012
Other color is use "colorbar" this command
only zero value use white
Jan
Jan le 28 Nov 2012
When you post the relevant part of your code, inserting modifications is much easier. Test data can usually created by RAND.

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 28 Nov 2012
Get the colormap, set 0 to white, then reapply it.
cm = colormap;
cm(0, :) = [255 255 255];
colormap(cm);
  5 commentaires
Image Analyst
Image Analyst le 28 Nov 2012
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 le 28 Nov 2012
ok,it's looks good. thank you~

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Color and Styling dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by