Printing and Exporting Figures with MATLAB    

Examples

Example -- Setting the Paper Size to 8.5-by-14 Inches

By default, MATLAB uses 8.5-by-11 inch paper. This example shows how to change the setting to another size by selecting a paper type.

  1. Select Page Setup from the figure window's File menu.
  2. Select the Paper tab
  3. Select the Legal paper type from the list under Paper size. The width and height fields update to 8.5 and 14, respectively.
  4. Make sure that Units is set to Inches.
  5. Click OK.

To perform this task with MATLAB commands, use,

or

Example -- Setting the Size of and Centering a Figure

This example sets a size of 5.5-by-3 inches for the figure and, if printing, centers it on the paper.

  1. Select Page Setup from the figure window's File menu and select the Size and Position tab.
  2. Make sure that Use screen size, centered on page is unchecked.
  3. Enter 5.5 in the Width field and 3 in the Height field. (You can type these values or click the arrows to select the new size.)
  4. Make sure that Units field is set to Inches.
  5. Click Center.
  6. Click OK.

To perform this task using MATLAB commands, first set PaperUnits to inches.

Now, use PaperSize to return the size of the current paper.

Set the figure width to 5.5 and the height to 3.

Calculate a left margin that centers the figure horizontally on the paper. Use the first element of PaperSize (width of paper) for the calculation.

Calculate a bottom margin that centers the figure vertically on the paper. Use the second element of PaperSize (height of paper) for the calculation.

You are now ready to set the figure size and print.


 Changing Figure Size and Position Fine-Tuning Your Output