contourf change plot color

7 Ansichten (letzte 30 Tage)
Steven
Steven am 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!

Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 18 Apr. 2012
contourf(magic(5))
colormap([1 1 1]) %set the colormap to one level - white
  3 Kommentare
Steven
Steven am 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 am 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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by