MATLAB: Doesn’t a figure open when I double-click on a .fig file

"hiddenfigfig-filefigureMATLABno

I saved a figure as shown:
 
>> savefig('MyFigure.fig')
However, when I double-click to open the figure, no figure is displayed.

Best Answer

The figure saved may have its "Visibility" property set to "off". To open and view the figure, try executing:
 
>> f = openfig('MyFigure.fig');
>> f.Visible = 'on';
You may have saved an invisible figure by accident if it was the currently active figure (the figure returned by gcf). Before saving a figure, make sure you select its window just prior to executing the savefig function so you can be sure it is the currently active figure (i.e. the last figure clicked with the mouse).