Main Content

printpreview

Open figure Print Preview dialog box

Syntax

printpreview
printpreview(f)

Description

Note

printpreview is not supported in App Designer or in apps created using the uifigure function. Instead, use exportapp to create a printable snapshot of your app.

printpreview displays a dialog box showing the figure in the currently active figure window as it will print. A scaled version of the figure displays in the right-hand pane of the dialog box.

printpreview(f) displays a dialog box showing the figure having the handle f as it will print.

Use the Print Preview dialog box, shown below, to control the layout and appearance of figures before sending them to a printer or print file. Controls are grouped into four tabbed panes: Layout, Lines/Text, Color, and Advanced.

Right Pane Controls

You can position and scale plots on the printed page using the rulers in the right-hand pane of the Print Preview dialog. Use the outer ruler handlebars to change margins. Moving them changes plot proportions. Use the center ruler handlebars to change the position of the plot on the page. Plot proportions do not change, but you can move portions of the plot off the paper. The buttons on that pane let you refresh the plot, close the dialog (preserving all current settings), print the page immediately, or obtain context-sensitive help. Use the Zoom box and scroll bars to view and position page elements more precisely.

The Layout Tab

Use the Layout tab, shown above, to control the paper format and placement of the plot on printed pages. The following table summarizes the Layout options:

Group

Option

Description

Placement

Auto

Let MATLAB® decide placement of plot on page*

 

Use manual...

Specify position parameters for plot on page*

 

Top, Left, Width, Height

Standard position parameters in current units

 

Use defaults

Revert to default position

 

Fill page

Expand figure to fill printable area

 

Best fit

Expand figure to fill printable area, center the figure, and preserve the figure’s aspect ratio

 

Center

Center plot on printed page

Paper

Format

U.S. and ISO® sheet size selector

 

Width, Height

Sheet size in current units

Units

Inches

Use inches as units for dimensions and positions

 

Centimeters

Use centimeters as units for dimensions and positions

 

Points

Use points as units for dimensions and positions

Orientation

Portrait

Upright paper orientation

 

Landscape

Sideways paper orientation

 

Rotated

Currently the same as Landscape

* Selecting Auto in the Placement group sets the figure PaperPositionMode to 'auto' and disables the controls in that panel. Selecting Use manual size and position sets the figure PaperPositionMode to 'manual' and enables the controls. If you set PaperPositionMode programmatically, the print preview Placement controls respond accordingly.

The Lines/Text Tab

Use the Lines/Text tab, shown below, to control the line weights, font characteristics, and headers for printed pages. The following table summarizes the Lines/Text options:

Group

Option

Description

Lines

Line Width

Scale all lines by a percentage from 0 upward (100 being no change), print lines at a specified point size, or default line widths used on the plot

 

Min Width

Smallest line width (in points) to use when printing; defaults to 0.5 point

Text

Font Name

Select a system font for all text on plot, or default to fonts currently used on the plot

 

Font Size

Scale all text by a percentage from 0 upward (100 being no change), print text at a specified point size, or default to this used on the plot

 

Font Weight

Select normal, light, demi, or bold font styling for all text from drop-down menu or default to the font weights used on the plot

 

Font Angle

Select normal, italic or oblique font styling for all text from drop-down menu or default to the font angles used on the plot

Header

Header Text

Type the text to appear on the header at the upper left of printed pages, or leave blank for no header. Header text only supports plain text characters.

 

Date Style

Select a date format to have today's date appear on each printed page, or none for no date

The Color Tab

Use the Color tab, shown below, to control how colors are printed for lines and backgrounds. The following table summarizes the Color options:

Group

Option

Description

Color Scale

Black and White

Select to print lines and text in black and white, but use color for patches and other objects.

 

Gray Scale

Convert colors to shades of gray on printed pages.

 

Color

Print everything in color, matching the color of the plot. Select RGB (default) or CMYK.

Background Color

Same as figure

Print the figure's background color as it is.

 

Custom

Select a color name, or type a colorspec for the background. white (default) implies no background color, even on colored paper.

The Advanced Tab

Use the Advanced tab, shown below, to control finer details of printing, such as limits and ticks, renderer, resolution, and the printing of UIControls. The following table summarizes the Advanced options:

Group

Option

Description

Axes limits and ticks

Recompute limits and ticks

Redraw x- and y-axes ticks and limits based on printed plot size (default)

 

Keep screen limits and ticks

Use the x- and y-axes ticks and limits shown on the plot when printing the previewed figure

Miscellaneous

Renderer

Select a rendering algorithm for printing: painters, OpenGL, or auto (default)

 

Resolution

Select resolution to print at in dots per inch: 150, 300, 600, or auto (default), or type in any other positive value

 

Print UIControls

Print all visible UI components in the figure (default), or uncheck to exclude them from being printed

Alternatives

Use File > Print Preview on the figure window menu to access the Print Preview dialog box, described below. For details, see Print Figure from File Menu.

Version History

Introduced before R2006a