MATLAB: Do I receive different results when I use the SAVEAS function and File -> Save As within the MATLAB Figure window in MATLAB 7.0 (R14)

asfigureMATLABsave

Why do I receive different results when I use the SAVEAS function and File -> Save As within the MATLAB Figure window in MATLAB 7.0 (R14)?
In MATLAB 6.5.1 (R13SP1), using the SAVEAS function to save a picture to a file produced the same results as using File>Save As from the figure menu bar. In MATLAB 7 (R14), the two commands produce different results. Specifically, if I have set my axes to a color, the SAVEAS function produces a white axes and File>Save As produces the color axes.
If I switch the figure 'InvertHardCopy' property to 'Off', the SAVEAS function creates a figure containing both the figure and axes color. However, File -> Save As does not reproduce the figure color. Below is some example code to demonstrate the occurrence.
% create plot
plot(1:10)
% set axes color to dark blue
set(gca, 'Color', [0 0 .3])
% save to file

saveas(gcf, 'commandLineSaveAs.jpg')
pause % during pause, use File -> Save As
% and save to file (e.g.fileSaveAs.jpg)
% Then hit key to resume
% set InvertHardCopy to 'off'
set(gcf, 'InvertHardCopy', 'off')
% save to file
saveas(gcf, 'commandLineSaveAsInvert.jpg')
% now use File -> Save As and
% save to file (e.g. fileSaveAsInvert.jpg)

Best Answer

This has been verified as a bug in MATLAB 7.0 (R14) in the way that the "File -> Save As" feature handles the "InvertHardCopy" property of the figure.
Currently, to work around this issue, continue using the SAVEAS function.
You can also export the figure to keep the background color as it appears in the figure window. Go to File>Export setup in the figure window. When the Export Setup dialog box comes up, click on Rendering in the left pane. Then, uncheck the box next to Custom Color. This will export the figure as it appears in the figure window.