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

49 次查看(过去 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])

Giorgos Papakonstantinou
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!

请先登录,再进行评论。


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