contourf change plot color

7 次查看(过去 30 天)
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!

采纳的回答

Sean de Wolski
Sean de Wolski 2012-4-18
contourf(magic(5))
colormap([1 1 1]) %set the colormap to one level - white
  3 个评论
Steven
Steven 2012-4-19
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 2012-4-19
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by