How to reopen a same figure with different buttons in Matlab App designer
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
RITAM BASU
el 21 de Ag. de 2022
Respondida: Walter Roberson
el 22 de Ag. de 2022
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1103635/image.jpeg)
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.
0 comentarios
Respuesta aceptada
Walter Roberson
el 22 de Ag. de 2022
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Specifying Target for Graphics Output en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!