In short, use export_fig like everyone else.
How to callback and save a plot, as image in guide?
3 views (last 30 days)
Show older comments
I have created a GUI with radio buttons which plots two graphs at a time in the interface. There is also a write results push button which when pushed stores data in excel sheet, along with this I also want to save the plots in the .jpeg format to the same folder. Since this has to be done once the button is pushed , I want a similar command like setappdata to set the plot with some specific name and later in the push button function I can getappdata and store using Imwrite. Please suggest a function to store the plot and then call back in another function.
Attached is the image of GUI
0 Comments
Answers (2)
Yudi
on 20 Oct 2018
1 Comment
Image Analyst
on 20 Oct 2018
It could be that your using "path" as the name of your variable is causing problems. path is a built-in reserved variable that you should never overwrite/destroy. Call it "folder" and try again.
I also don't see any need for pause(1).
Also, you can use the more convenient OOP method of setting properties instead of using the old fashioned get() and set():
handles.result.String = 'Results Saved';
See Also
Categories
Find more on Graphics Object Programming 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!