In the event you have stored the result of running a PLOT command in the GUI FIG-file, please execute the following code to clear the axes in your GUI:
1. Run your GUI.
2. At the Command Window type the following:
set(0,'ShowHiddenHandles','on');
cla;
hgsave('mygui.fig');
set(0,'ShowHiddenHandles','off');
The issue of the plot being saved in the axes of the GUI is not due to information saved in the handles structure. When you save a GUIDE FIG-file during operation of the GUI, data reflecting the current state of the GUI is stored in the FIG-file. This data is not visible in the corresponding code file and therefore it cannot be deleted by manipulating the handles structure.
The figure toolbar and menubar are not present in a GUI created in GUIDE by default since saving data while the GUI is open will cause data to be saved in the .FIG file. This information is not accessible from the code file. Hence it is recommended not to have the save button and in general the menubar in a GUI.
Best Answer