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 CenterFile Exchange에서 2-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