Addressing figure calls to UIAxes in App Designer

Hello everyone,
I have this code that executes a series of graphical operations, such as creating segments, points, arc segments and so on. This code was intended to be used via MATLAB scripts, but now I'm moving this all to App Designer. All this is done by various functions, so there's a function that plots a point on a figure, a function that plots a segment between two points and so on. Is there a way to make those functions plot straight to the UIAxes element in the App, possibly without editing them? Or, even better, implementing a figure object inside an app made in App Designer, that doesn't generate a separate window?
Thanks in advance

 Accepted Answer

You cannot do it by implementing a figure object that is not a seperate figure. "apps" are figure objects that have behaviour attached to them, and you cannot nest figure objects.
The trick to get uifigure() recognized by gcf() and similar, is that by default uifigure() have HandleVisibility set to 'callback', but many uses of gcf() are assuming that HandleVisibility is set to 'on'. So just set the uifigure HandleVisibility to 'on' and gcf() will start working on it.

1 Comment

That seems to be exactly what I was looking for.
Thanks a lot!

Sign in to comment.

More Answers (0)

Categories

Find more on Develop Apps Programmatically in Help Center and File Exchange

Products

Release

R2024b

Community Treasure Hunt

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

Start Hunting!