How do you set the focus to a specific uiaxes
Show older comments
I am designing an app with the new App Designer format and would like to be able to set the focus of my uifigure to draw on a specific set of uiaxes when I activate a particular callback.
When I attempt to target the axis for plotting using
axes(app.UIAxes)
I get the following error:
Error using axes
Functionality not supported with figures created with the uifigure function.
And calling:
uiaxes(app.UIAxes)
yields:
Error using uiaxes (line 32)
UIAxes cannot be a child of UIAxes.
Is it possible to set the current axes/panel of a uifigure object via their handle? How do I go back add a plot to uiaxes after having created them and subsequently edited other components on the uifigure?
Accepted Answer
More Answers (1)
Walter Roberson
on 6 Sep 2024
0 votes
Somewhere around R2020b (possibly R2020a) it became possible to axes() the handle to a uiaxes to bring it into focus.
(It did not work in R2019b; I do not happen to have R2020a installed to test with.)
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!