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

70 ビュー (過去 30 日間)
Giorgos Papakonstantinou
Giorgos Papakonstantinou 2013 年 6 月 1 日
編集済み: Ben Ralph 2018 年 11 月 27 日
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 Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by