orient

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' .

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

Set Landscape Orientation with Current Figure Size

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')

Set Landscape Orientation with Expanded Figure Size

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')

Return Current Paper Orientation Value

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

figure surf(peaks) or = orient
or = 'portrait'

Input Arguments

ornt — Paper orientation
portrait (default) | landscape | tall

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

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

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 orientation. Set the PaperOrientation property to 'portrait' .

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] .

fig — Target figure or Simulink model
figure object | Simulink model

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

See Also

MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Select a Web Site Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe