This is an issue of setting the right preferences for exporting the figure in MATLAB 7.1 (R14SP3) when using other background colors than white.
There is a default setting 'w' (for white) in the figure menu under File > Export Setup > Rendering > Custom Color. When you remove the checkmark, the background color will not be reset.
Programmatically, this can be done using the property InvertHardCopy of the figure.
surf(peaks);
set(gcf,'Color',[0.2 0.2 0.2]);
set(gcf,'InvertHardCopy','Off');
print('-f1', '-r600', '-djpeg', 'peaksfig');
A detailed explanation about printing and exporting in the current release of MATLAB is given at the following link:
<http://www.mathworks.com/help/releases/R2012b/matlab/creating_plots/how-to-print-or-export.html>
Best Answer