clear distinction between positive and negative values in plot

조회 수: 3 (최근 30일)
Chiel van Wanrooij
Chiel van Wanrooij 2023년 1월 10일
답변: dpb 2023년 1월 10일
[K,H,Pmax,Pmin] = surfature(X1,Y1,Zplane);
figure(4)
D = mesh(X1,Y1,Zplane,K);
set(gca,'clim',[-1,1])
xlim([0 84.83])
ylim([0 63.60])
xlabel('x [\mum]')
ylabel('y [\mum]')
zlabel('z [\mum]')
colorbar
Hello,
It is really hard to see what are positive curvatures and what are negative curvatures. I would like to have for all the positive values one color (yellow), and for all negative values on color (blue). How can I specify that in my figure?
Thank you.
  댓글 수: 1
Jiri Hajek
Jiri Hajek 2023년 1월 10일
편집: Jiri Hajek 2023년 1월 10일
Hi, there are several solutions available here on the forum, perhaps this one could suit you, or maybe this one....

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

채택된 답변

dpb
dpb 2023년 1월 10일
Try
mymap=[0 0 1;1 1 0];
mesh(peaks)
colormap(mymap)
If the mean of your surface isn't zero, you might want to plot sign(Zplane) instead.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by