필터 지우기
필터 지우기

Auto axis limits not working as expected

조회 수: 2 (최근 30일)
Andrew Haselgrove
Andrew Haselgrove 2019년 5월 30일
댓글: Andrew Haselgrove 2019년 5월 30일
I have a graph for which I want to limit the y axis to be positive. Research suggested to me the way to do this was ylim([0, inf]). However, rather than giving a 'nice' upper limit (like the default does), this command just sets the upper limit to the maximum value in my dataset. Is there a way to achieve what I am after? The best I have found is
yl = ylim()
ylim(0, yl(2))
but this doesn't allow the upper limit to continue updating if additional plots were included.
  댓글 수: 2
Stephen23
Stephen23 2019년 5월 30일
편집: Stephen23 2019년 5월 30일
" Is there a way to achieve what I am after?"
Not easily, as far as I am aware. I think this behavior should be reported as a bug: it is quite reasonable to expect that the Inf limit should produce the same as the auto limits.
What MATLAB version are you using?
Andrew Haselgrove
Andrew Haselgrove 2019년 5월 30일
2019a

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by