Main Content

orient

Paper orientation for printing or saving

Description

example

orient ornt specifies the paper orientation to use when printing or saving the current figure to a paged format, such as PDF. Specify the orientation as either portrait, landscape, or tall. Figure property values related to printing, such as the PaperPositionMode value, affect the behavior.

orient(fig,ornt) sets the paper orientation for the figure or Simulink® model specified by fig. Use single quotes around the orientation option, such as 'portrait'.

example

or = orient returns the paper orientation value for the current figure as either 'portrait', 'landscape', or 'tall'.

or = orient(fig) returns the paper orientation value for the figure or Simulink model specified by fig.

Examples

collapse all

Create a figure with a surface plot and save the figure to a PDF format. Save the figure with the same size that it appears on screen and use a landscape orientation for the page.

fig = figure;
surf(peaks)
orient(fig,'landscape')
print(fig,'LandscapePage.pdf','-dpdf')

Create a figure with a surface plot and save the figure to a PDF format. Use landscape orientation for the page and expand the figure size to fill page.

fig = figure;
surf(peaks)
fig.PaperPositionMode = 'manual';
orient(fig,'landscape')
print(fig,'LandscapePage_ExpandedFigure.pdf','-dpdf')

Create a surface plot. Return the current paper orientation value for the figure.

figure
surf(peaks)
or = orient
or =

    'portrait'

Input Arguments

collapse all

Paper orientation, specified as one of the values in this table.

ValueDescription
landscape

Landscape orientation. Set the PaperOrientation property to 'landscape'.

  • If the PaperPositionMode property of the figure is set to 'auto' (the default), then print or save the figure using the size of the figure on the screen.

  • If the PaperPositionMode property of the figure is set to 'manual', then resize the figure to fit across the entire page with a 0.25-inch margin. Set the PaperPosition property accordingly.

tall

Tall portrait orientation. Set the PaperOrientation property to 'portrait' and resize the figure to fit across the entire page with a 0.25-inch margin. Set the PaperPosition property accordingly.

portrait

Portrait orientation. Set the PaperOrientation property to 'portrait'.

  • If the PaperPositionMode property of the figure is set to 'auto', then print or save the figure using the size of the figure on the screen.

  • If the PaperPositionMode property is 'manual', then set the PaperPosition property based on the default PaperType and PaperOrientation values. For details, see Effect of Default Values on portrait option.

Effect of Default Values on portrait Option

The default PaperType and PaperOrientation properties affect the result of the portrait option in these ways.

Default Versus Current Figure PaperType ValueDefault PaperOrientation ValueCurrent Figure PaperOrientation ValueResult
Same value'portrait'Not applicablePosition the figure on the page using the default PaperPosition value for figures. In inches, it typically is [0.25 2.5 8 6].
Same value'landscape'Not applicablePosition the figure on the page using the reverse of the default PaperPosition value for figures. In inches, it typically is [2.5 0.25 6 8].
Different valuesNot applicable'portrait'Position the figure on the page using the current PaperPosition value for the figure.
Different valuesNot applicable'landscape'Position the figure on the page using the reverse of the current PaperPosition value for the figure, such as[y x height width].

Target figure or Simulink model, specified as a figure object or Simulink model. If you do not specify the figure or model, then orient uses the current figure.

Version History

Introduced before R2006a