How can I use plotmatrix over UIAxes in app designer?

조회 수: 1 (최근 30일)
Mohammad Shahbazy
Mohammad Shahbazy 2021년 7월 30일
댓글: Dave B 2021년 7월 30일
Hi All,
I want to use plotmatrix over UIAxes in app designer but I encounter with an error message as follow:
X = rand(1000,3);
plotmatrix(app.UIAxes,X,'.b');
*Error:
Adding a plotmatrix to a container with the 'AutoResizeChildren' property set to 'on' is not supported.
How can I resolve this issue? Can you please help me to correct my code? I could not set 'AutoResizeChildren' of UIAxes to 'off'.
Thanks in advance,
MS

채택된 답변

Dave B
Dave B 2021년 7월 30일
AutoResizeChildren is a property on the UIFigure, not the UIAxes.
If you select app.UIFigure in the Component Browser you'll see AutoResizeChildren under Position
More details about this property here.
  댓글 수: 2
Mohammad Shahbazy
Mohammad Shahbazy 2021년 7월 30일
Thanks @Dave B
It works manually. I need to deactivate 'AutoResizeChildren' before and activate that after the command line. I need to turn back to the original state for other callbacks, but I can't by something like this:
app.UIFigure.AutoResizeChildren = 'off';
plotmatrix(app.UIAxes,X,'.b');
app.UIFigure.AutoResizeChildren = 'on';
Is it possible? Please let guide me how.
Dave B
Dave B 2021년 7월 30일
That gets a little tricky, I think that plotmatrix wants it off, not just off temporarily.
The documentation for UIFigure's AutoResizeChildren indicates that "The AutoResizeChildren property affects direct children of the container, not children inside nested containers."
If you need AutoResizeChildren to be on for other aspects of the app, you might try putting the plotmatrix in a panel and turning off AutoResizeChildren for the panel (i.e. by making a panel, putting the uiaxes in the panel, and turning AutoResizeChildren off for the panel before calling plotmatrix).
This page has some other suggestions regarding alternatives to AutoResizeChildren and probably is more clear about how it works than I can be!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by