Why do colorbar limits not match the values specified by the CAXIS function in MATLAB 7.0 (R14) when using the CONTOUR or CONTOURF function?

조회 수: 4 (최근 30일)
When I execute the following commands, the color bar limits do not match those of my contour plot:
contourf(peaks) % contour(peaks)
caxis([-2 2])
colorbar
I expected the color bar limits to range from -2 to 2, however, the limits range from -6 to 8.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2009년 6월 27일
This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
A bug in MATLAB 7.0 (R14) causes color axis limits on a graph created using the CONTOUR or CONTOURF functions to be set incorrectly.
To work around this issue, use the CONTOUR/CONTOURF function with the 'v6' switch. For example,
contourf('v6',peaks) % contour('v6',peaks)
caxis([-2 2])
colorbar

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