Change a specific color(assigned to a value) con a colorbar?

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!

 Accepted Answer

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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!