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

12 views (last 30 days)
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

Walter Roberson
Walter Roberson on 2 Apr 2012
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!