필터 지우기
필터 지우기

Help with contour plot

조회 수: 8 (최근 30일)
aurc89
aurc89 2014년 9월 2일
댓글: aurc89 2014년 9월 2일
Hello! I have a 'contour' plot like the one in the figure.
As you can see, there is a lot of white space, and only a discrete set of colors in my figure, although the bar on the right shows a continuum range of color shades. Is there a way to see a plot able to show a more detailed chromatic scale? Maybe I need to increase the number of contours, but I don't know how. The only lines in my code are the following:
figure
contourf(x,y,M)
colormap(b2r(-0.15,0.25))
colorbar
Thanks for the help

채택된 답변

Kelly Kearney
Kelly Kearney 2014년 9월 2일
You can increase the number of contours using a fourth input, specifying either the number of lines or the values
contourf(x,y,M,50); % 50 contour lines
contourf(x,y,M, [-0.15:0.05:0.2]);
The latter option is better if you want uneven spacing of contours, for example higher resolution of lines near 0.
You might also be interested in this function: contourfcmap, which allows you to specify exactly which color you want to use for each interval.
  댓글 수: 1
aurc89
aurc89 2014년 9월 2일
Thanks!

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

추가 답변 (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