a specific colormap for filled contour plot

조회 수: 3 (최근 30일)
Silin
Silin 2014년 3월 17일
댓글: per isakson 2014년 3월 18일
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.

답변 (3개)

per isakson
per isakson 2014년 3월 17일
편집: per isakson 2014년 3월 17일
Yes, you can make a special colormap to accomplish that
  댓글 수: 2
Silin
Silin 2014년 3월 18일
Thank you. Is there a function that do the opposite as bluewhitered? Meaning put the negative as red and positive as blue?
Thanks again.
per isakson
per isakson 2014년 3월 18일
Try something like
redwhiteblue = flipud( bluewhitered );

댓글을 달려면 로그인하십시오.


Kelly Kearney
Kelly Kearney 2014년 3월 17일
I like usercolormap to create quick, reusable colormaps.

Silin
Silin 2014년 3월 18일
Thanks a lot! I was able to use bluewhitered and modify it a bit to change it from redwhiteblue.
Thanks again for your help!

카테고리

Help CenterFile Exchange에서 Red에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by