Printing and Exporting Figures with MATLAB | ![]() ![]() |
Changing Figure Size and Position
This section describes how to set the size and position of the figure to specific values. Depending on the size and orientation of the paper, changing the size or position of the figure can cause it to print off the edges. For more information, see Relationships Among Settings.
Note The figure does not resize on the screen. The settings only affect the output. If printing, you can use Print Preview to see how it will look on the page. |
Using the Page Setup Dialog Box
For detailed information about the Size and Position tab of the Page Setup dialog box, see its context sensitive help by clicking its Help button.
Using MATLAB Commands
To print your figure with a specific size, make sure that the PaperPositionMode
property is set to manual
(the default). Then set the PaperPosition
property to the desired size and position.
The PaperPosition
property references a four-element row vector that specifies the position and dimensions of the printed output. The form of the vector is
distance_from_left
specifies the distance from the left edge of the paper to the left edge of the figure.
distance_from_bottom
specifies the distance from the bottom of the paper to the bottom of the figure.
width
and height
specify the figure's width and height.
These are the MATLAB default values for PaperPosition
.
This example sets the figure size to a width of 4 and height of 2,
with the origin of the figure positioned two units of measure from the left edge of the paper and one unit of measure from the bottom edge of the paper.
Changing Default Size or Position
If you always want to print or export your figures at a defined size, set the default values for PaperPosition
in your startup.m
file. For example, this line sets the default size to [0 0 4 3]
.
If you always want to print or export your figures at the same size as they are on the screen, modify the setting for DefaultFigurePaperPositionMode
in your startup.m
file as follows
![]() | Size and Position of Printed or Exported Figures | Examples | ![]() |