MATLAB: Change a specific color(assigned to a value) con a colorbar

colorcolorbarwhite

Hi, I have a colorbar that assigns the color blue to the value 0. I'd like to specifically assign the color 'white' to the value 0. How can this be done? Thank you!

Best Answer

cmap = colormap; %current map
cmap(1,:) = [1 1 1]; %make first color white
colormap(cmap); %put it into effect
Related Question