フィルターのクリア

Is it possible to just set the lower limit of the y-axis?

9 ビュー (過去 30 日間)
min lee
min lee 2024 年 4 月 19 日
コメント済み: Star Strider 2024 年 4 月 19 日
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
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)
Star Strider
Star Strider 2024 年 4 月 19 日
This should work —
ylim([0 max(ylim)])
.

サインインしてコメントする。

採用された回答

Julius Muschaweck
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 件)

カテゴリ

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