Is it possible to just set the lower limit of the y-axis?
조회 수: 6 (최근 30일)
이전 댓글 표시
I just want to set the lower limit of the y-axis to zero.
But with 'ylim', I have to also set the upper limit, which I do not know what value is appropriate.
What should I do?
댓글 수: 2
Mathieu NOE
2024년 4월 19일
you could set the upper limit to the max of the displayed data (so compute the max and use it in the ylim arguments)
채택된 답변
Julius Muschaweck
2024년 4월 19일
Two related ways I'm aware of (besides computing the max, which may be tedious with multiple plotted lines).
xx = linspace(0,2*pi,100);
yy = sin(xx);
figure(14);
clf;
plot(xx,yy);
%%
ax = gca;
ax.YLim(1) = 0;
%%
yl = ylim();
ylim([0,yl(2)]);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!