Can set the lower limit of the axis manually but leaving to auto the upper limit

조회 수: 47 (최근 30일)
I want to control only the lower limit of the axis and not the upper. I want the upper to be automatic. Is there any way to do it with set?

답변 (3개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 1일
xlim([2 inf])
ylim([4 inf])
  댓글 수: 1
Ben Ralph
Ben Ralph 2018년 11월 27일
편집: Ben Ralph 2018년 11월 27일
This one worked well for me.
Well, I actually used:
ax = gca;
ax.YLim = [0 inf];
Thanks!

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


Giorgos Papakonstantinou
Giorgos Papakonstantinou 2013년 6월 1일
I did finally this. If I want for example my lower limit to be 2:
limsy=get(gca,'YLim');
set(gca,'Ylim',[2 limsy(2)];
  댓글 수: 7
Pw
Pw 2014년 9월 4일
The solution worked great for me:
limsy=get(gca,'YLim');
set(gca,'Ylim',[2 limsy(2)];
Quick question, what does the 2 in limsy(2) indicate. I feel as if I should know the answer but it is eluding me at the moment.
Thanks!
Jason
Jason 2014년 11월 18일
2nd value from Ylim (i.e it consists of ymin and ymax), so it reports back ymax

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


Walter Roberson
Walter Roberson 2013년 6월 1일
No.
You could probably work something up using a listener or two to detect changes to the xdata or ydata and to set() the xlim and ylim as appropriate. I wouldn't bother doing it that way, though.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by