a specific colormap for filled contour plot

Hi All,
I was using contourf for filled contour plotting. And I've added standard colorbar to display the color. Then I've got comments from client that they would like the contour to be plotted in a more specific way - they would like to use white for zero, and then the color should go from white to red as number gets more negative, and white to blue as the number gets more positive.
Is it something can be done in Matlab?
Thank you.

Réponses (3)

per isakson
per isakson le 17 Mar 2014
Modifié(e) : per isakson le 17 Mar 2014

0 votes

Yes, you can make a special colormap to accomplish that

2 commentaires

Silin
Silin le 18 Mar 2014
Thank you. Is there a function that do the opposite as bluewhitered? Meaning put the negative as red and positive as blue?
Thanks again.
Try something like
redwhiteblue = flipud( bluewhitered );

Connectez-vous pour commenter.

Silin
Silin le 18 Mar 2014

0 votes

Thanks a lot! I was able to use bluewhitered and modify it a bit to change it from redwhiteblue.
Thanks again for your help!

Question posée :

le 17 Mar 2014

Commenté :

le 18 Mar 2014

Community Treasure Hunt

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

Start Hunting!

Translated by