Graphics    

Printing a Centered Figure

This example sets the size of a figure to 5.5-by-3 inches and centers it on the paper.

Using the Graphical User Interface

  1. Select Page Setup from the figure window's File menu, and select the Size and Position tab.
  2. Make sure Use manual size and position is selected.
  3. Enter 5.5 in the Width field and 3 in the Height field.
  4. Make sure that Units field is set to inches.
  5. Click Center.
  6. Click OK.
  7. Open the Print dialog box and print the figure.

Using MATLAB Commands

  1. Start by setting PaperUnits to inches.
  2. Use PaperSize to return the size of the current paper.
  3. Initialize variables to the desired width and height of the figure.
  4. Calculate a left margin that centers the figure horizontally on the paper. Use the first element of papersize (width of paper) for the calculation.
  5. Calculate a bottom margin that centers the figure vertically on the paper. Use the second element of papersize (height of paper) for the calculation.
  6. Set the figure size and print.

  Printing with a Specific Paper Size Exporting in a Specific Graphics Format