MATLAB: Could I change the color of specific point

colorbar

Hi, all
I have a matrix 49×49,
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.

Best Answer

Get the colormap, set 0 to white, then reapply it.
cm = colormap;
cm(0, :) = [255 255 255];
colormap(cm);