axis equal - a bug in the function?

조회 수: 3 (최근 30일)
michael
michael 2020년 12월 26일
편집: Stephen23 2020년 12월 26일
Hi,
when executing following
plot(1:10)
axis equal
I'm getting a figure as below, which seems not to comply with the definition of the equal: "Use the same length for the data units along each axis"

답변 (2개)

Peter Nave
Peter Nave 2020년 12월 26일
The units ARE the same, take a ruler and measure them on the monitor!

Bruno Luong
Bruno Luong 2020년 12월 26일
편집: Bruno Luong 2020년 12월 26일
It is. The unit length is the same, not the total length of the axis.
If you want to enforce the limits use xlim/ylim commands after axis equal.
  댓글 수: 6
Bruno Luong
Bruno Luong 2020년 12월 26일
편집: Bruno Luong 2020년 12월 26일
"you have same issue"
No he has not. You simply fail to understand what "axis equal" does despite of three people telling you what it suppose to do.
You are stuck in your onw logic which is NOT "axis equal" supposes to do.
Stephen23
Stephen23 2020년 12월 26일
편집: Stephen23 2020년 12월 26일
"Rest my case - you have same issue. The scale is 20, but on your x axis, you have more than 20 points."
The axis documentation does not state anything about how many units (i.e. the range) will be displayed for each of the axes, it only defines that their unit lengths will be the same: "equal Use the same length for the data units along each axis." For some reason you seem to be confusing the data range with unit length.
The statement "you have more than 20 points." is in any case incorrect: there are exactly eleven data points plotted on the axes in my previous comment (I just added a marker so that everyone can count them).

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

카테고리

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

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by