How to reopen a same figure with different buttons in Matlab App designer

3 次查看(过去 30 天)
Hello,
In the app I am working on, I am trying to achieve the following functionality -
As can be seen in the picture, there are 4 buttons. button 1 (PLOT) plots 2 graphs in UIAxes(in the app). Button 2&3 (open in new Window) open the graphs individually in new figure windows and button 4(EXPORT) saves this plots to a desired folder.
Currently, I am plotting in UIAxes, then I am plotting a new graph in a new window, then I am plotting a new graph in new window to export it.
But it is not a nice solution.
So, is there any way I can store the figure (maybe as a property) in the app and can recall when different buttons (2,3,4) were pressed?
I am trying to get the figure or its handles (as an output) from the function I run when button 1 is pushed, and then store it as a property in the app, then call this figure when button 2,3,4 are pushed. I am getting the handle, but not being able to reconstruct the figure after that.
Have a nice day.

采纳的回答

Walter Roberson
Walter Roberson 2022-8-22
You can store handles to figures as "properties" of your app, or you can store them as UserData properties of any of a number of kinds of objects.
However the handles would have to be to figures that currently exist. You might possibly switch the figure between visible and not.
Otherwise you would have to use the callbacks to openfig()... though at the moment I am not sure what the support is for openfig and app designer

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by