필터 지우기
필터 지우기

contour plot control in Surfc function

조회 수: 1 (최근 30일)
Youngki Yeo
Youngki Yeo 2020년 3월 27일
댓글: Star Strider 2020년 4월 15일
I have some questions in handling surfc functions
In, surfc functions
[rr,thth]=meshgrid(0:0.005:0.7,0:1:360);
xx=rr.*cosd(thth);
yy=rr.*sind(thth);
rrr=1/4.5*(sqrt(xx.^2+yy.^2)).^3-1/8*(sqrt(xx.^2+yy.^2)).^2+0.25;%rrr=1/4*(sqrt(xx.^2+yy.^2)).^4-1/2*(sqrt(xx.^2+yy.^2)).^2-cosd(8*thth)
rrr(:)=(rrr(:)-min(min(rrr)))/(max(max(rrr))-min((min(rrr))));
zzz=sin(rrr)./rrr;
surfc(xx,yy,rrr); shading flat; caxis([0 1.0]);
ylim([-2 2]);xlim([-2 2])
zlim([-1 1]);
view(45,70);
In the above codes, I want to change the contour level step to 0.05 and contour position at z=-0.8, not z=0 (in default)
How can I change it ?
If I type contour('LevelStep',0.05) as contour examples, blank figures are pop up.
Also I cannot find the reference to control contour plot positions.
Can anyone help me ? Thanks.
  댓글 수: 1
Johannes Eyb
Johannes Eyb 2020년 4월 14일
I can only help you with the first question as i am looking for the answer to the second on my own:
surfc(xx,yy,rrr,'LevelStep',0.05)
should do the trick

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

채택된 답변

Star Strider
Star Strider 2020년 4월 14일
I did not see this before.
For the second, see: Customizing contour plots part 2 I asked about this a while ago, and MathWorks provided the solution that I then brought to Yair Altman’s attention. He posted it on his Undocumented MATLAB site.
  댓글 수: 2
Youngki Yeo
Youngki Yeo 2020년 4월 15일
Thank you. This is the answer what I was exactly looking for !
Star Strider
Star Strider 2020년 4월 15일
As always, my pleasure!

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

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