Reopen figure after closing it
Show older comments
I was running a long simulation and the result a plot and a figure was created. I accidentally closed the figure. Is there anyway to make the figure reappear?
Accepted Answer
More Answers (4)
Gottfried Langhans
on 20 Aug 2018
3 votes
As all your data you are plotting is still in the workspace you can just copy the lines which are creating your plot out of the script into the command window and press enter. It should take the Data from your workspace and plot it again very fast, as the solution of your simulation is not the figure itself but saved as vectors (or whatever youre plotting) in the workspace. Hope this still helps, worked for me ;)
1 Comment
Adam
on 20 Aug 2018
Depends if it was run in a script or a function!
Maha
on 28 Jan 2020
2 votes
It would be a great tool, like the unplot function when you do a mistake, the reopenlastfigure would be great
heinet
on 28 Jan 2020
1 vote
I have come to a working solution for myself. I save the whole environment as a ".mat"---either at console or in my script where neaded. Then, make your plotting scripts either separate cells (sections) you can execute again with ctrl+enter, or make them separate functions or scripts you can run against your saved environment variables. This at least saves you from having to run run a long simulation all over.
Sivabalan Selvarajan
on 15 Aug 2019
0 votes
You can copy the complete code into a script window and run it, the plots will be avilable on the right side of your script window after you run it, even after closing the figure window. You could reopen it anytime.
1 Comment
Walter Roberson
on 15 Aug 2019
I suspect this only applies for Live Script.
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!