MATLAB: Does the legend in the printed figure become larger after I manually move it in MATLAB 7.0.1 (R14SP1)

largerlegendMATLABmoveprintresize

I have a figure with a legend. If I print the figure with the legend in the same position as when it was created, the figure prints properly with the legend correctly sized. I then use my mouse to click and drag the legend to a new position, and then print the figure. In the printed figure, the legend becomes larger, with more white space and wider line spacing.

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
This legend resizing behavior in the printed figure is determined by the "Location" and "Units" properties of the legend. If the "Location" property is set to one of the predefined locations, such as "NorthEast" or "Best", the legend will not resize upon printing.
When the legend is manually moved or its "Position" property is manually set, the "Location" property is automatically set to "none". When the "Location" property is set to "none", the legend will print according to its "Position" and "Units" properties.
To prevent the printed legend from resizing after the legend has been moved, set the legend's "Units" property to something other than "normalized", such as "inches", as follows:
set(h_legend,'Units','inches')
Note that each time you move the legend, its "Units" property will be reset to "normalized". Therefore, you must reset it back to "inches" each time you reposition the legend. Also note that you cannot set the "Location" property to "None" directly, only by manually moving the legend or explicitly setting its "Position" property.
An alternative workaround is to set the figure's "Position" property such that the width and height of the figure match the width and height of the figure's "PaperPosition" property. This will prevent resizing of the figure upon printing. Thus, the on-screen layout of annotation objects will be preserved.