Wrong color in contourf plot

조회 수: 4 (최근 30일)
Audun Yrke
Audun Yrke 2016년 7월 4일
댓글: José-Luis 2016년 7월 4일
I have a matrix with variations in the order of -100 to 100, but I am only interested in what happens close to zero. Thus, I have defined a plotting range from -10 to 10. This works, BUT very low (negative) values becomes white instead of dark blue which it should be due to the colorbar. However, the color is correct for high (positive) values. What can I do to get correct color?
range = linspace(-10,10,11);
q = contourf(MX', MY', U{cam}(:,:,t), range);
contourcmap('jet',linspace(range(1),range(end),7),'colorbar','on','location','horizontal');
Best regards,
Audun Yrke

답변 (1개)

José-Luis
José-Luis 2016년 7월 4일
It seems like the command you are looking for is caxis() and not contourcmap().
  댓글 수: 2
Audun Yrke
Audun Yrke 2016년 7월 4일
Thank you for answering, but I'm afraid it is still white colour at the lowest value
José-Luis
José-Luis 2016년 7월 4일
Well, you're not gonna get a completely filled image using contour(). Maybe you are looking for something like surf() instead?

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

카테고리

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