필터 지우기
필터 지우기

How to set axis of a plot to correspond to their values.

조회 수: 1 (최근 30일)
Joseph Lee
Joseph Lee 2017년 12월 14일
댓글: Adam 2017년 12월 14일
x = 10:0.05:30;
z = 1:0.005:3;
[X,Z] = ndgrid(x,z);
mesh(X,Z,Y)
This is the plotting code, however the surface i got does not scale accordingly. It gives a scale of equal length for x and z instead of having z shorter and x longer. How do i adjust this such that the plot actually shows that the length of z axis is e.g 2 while length of x axis is a longer 20.

채택된 답변

Adam
Adam 2017년 12월 14일
편집: Adam 2017년 12월 14일
doc pbaspect
doc daspect
can be used to control the aspect ratio of the plotting area and the data.
Also
axis equal
will set the true [1 1 1] aspect ratio.
  댓글 수: 2
Joseph Lee
Joseph Lee 2017년 12월 14일
편집: Joseph Lee 2017년 12월 14일
i tried axis equal but it changes the Y variable axis as well, how do i set for only x and z to be true[1 1] such that the Y variable axis still remains the same as before
Adam
Adam 2017년 12월 14일
You need to use one of the two functions I mentioned first to give more specific control over the aspect ratios.

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

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