How to "shake loose" an auto scaling graph when it doesn't autoscale?

1 回表示 (過去 30 日間)
Ken
Ken 2024 年 4 月 21 日
編集済み: Voss 2024 年 4 月 21 日
Scenario: I load some data, a time series, into a uiaxes component. Everything looks beautiful:
My user then chooses a shorter portion of that series to work on. I redisplay the shorter data in the same uiaxes, and it doesn't resize:
Question: how to "shake it loose" and cause it to redo the auto scaling? I don't want to explicitly set the bounds of the graph if I don't have to, because then it is no longer auto scaling at all, and that's a pain. Is there a way to do this?

採用された回答

Voss
Voss 2024 年 4 月 21 日
編集済み: Voss 2024 年 4 月 21 日

Where ax is your uiaxes component:

xlim(ax,'auto')
ylim(ax,'auto')

or, equivalently:

ax.XLimMode = 'auto';
ax.YLimMode = 'auto';

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by