contourf change plot color

조회 수: 9 (최근 30일)
Steven
Steven 2012년 4월 18일
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