MATLAB: Does the legend reset to the default position and format when I export the figure in MATLAB 7.0 (R14)

exportexportinglegendMATLABposition;resetsavesaving

I create a plot and insert a legend. I then alter aspects of the format (e.g., font type, font size, etc.). When I export the plot, the legend moves. The following code reproduces the issue:
plot(1:10);
lh = legend(gca,0);
print -dbmp test.bmp

Best Answer

This bug has been fixed in Release 2006a (R2006a). For previous product releases, read below for any possible workarounds:
This issue is due to using an obsolete syntax. Starting from MATLAB 7.0 (R14), the syntax:
lh = legend('legend',0);
is no longer used. This is mentioned in the documentation for LEGEND.
The equivalent statement in the new syntax for LEGEND is:
lh = legend('legend','Location','Best');
Use the new syntax to resolve this issue.