contourf change plot color

7 views (last 30 days)
Steven
Steven on 18 Apr 2012
I am trying to change the contourf plot color to white. I understand that Matlab has several built-in colormaps and changing between these is easy. However, I just want the contour lines on a white background. I know plotting on a white background can be done with the contour command, but the data I am plotting is incomplete. "Contourf" will complete the data islands, but "contour" will not approximate the missing points on my map. Thank you for your help in advance!

Accepted Answer

Sean de Wolski
Sean de Wolski on 18 Apr 2012
contourf(magic(5))
colormap([1 1 1]) %set the colormap to one level - white
  3 Comments
Steven
Steven on 19 Apr 2012
I plugged "colormap([1 1 1])" into my code. Although it is turning the plot color white, it is also turning the plot title and axes white too. Is there a way to keep these black? Also, once I apply "colormap([1 1 1])", any colormap I change to after that only displays one color. For example colormap jet will only display one shade of blue instead of all of the map colors. Is there any way to restor the full color range? I have been trying to get the "refresh" or "clf" commands to work, but they either do nothing or remove the whole object.
Steven
Steven on 19 Apr 2012
haha. . . "colormap white" fixes all of these issues. I think sometimes I am assuming things are more complicated then they have to be. Thanks for listening.

Sign in to comment.

More Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!