Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Control relative lengths of each axis

`pbaspect(ratio)`

`pb = pbaspect`

`pbaspect auto`

`pbaspect manual`

`m = pbaspect('mode')`

`___ = pbaspect(ax,___)`

`pbaspect(`

sets
the plot box aspect ratio for the current axes. The plot box aspect
ratio is the relative length of the `ratio`

)*x*-axis, *y*-axis,
and *z*-axis. Specify `ratio`

as
a three-element vector of positive values that represent the ratio
of the *x*-axis, *y*-axis, and *z*-axis
lengths. For example, `[3 1 1]`

specifies that the
length of the *x*-axis is equal to three times
the length of the *y*-axis and *z*-axis.
For equal axis lengths in all directions, use `[1 1 1]`

.

`pbaspect `

sets
an automatic mode, enabling the axes to choose the appropriate plot
box aspect ratio. The mode must be automatic to enable the “stretch-to-fill”
feature of the axes.`auto`

`pbaspect `

sets
a manual mode and uses the ratio stored in the `manual`

`PlotBoxAspectRatio`

property
of the `Axes`

object. When the mode is manual, it disables
the stretch-to-fill feature of the axes. Specifying a value for the
plot box aspect ratio sets the mode to manual.

The `pbaspect`

function sets and queries several
axes properties related to the data aspect ratio.

`PlotBoxAspectRatio`

— Property that stores the plot box aspect ratio value.`PlotBoxAspectRatioMode`

— Property that stores the plot box aspect ratio mode. When you set the ratio, this property changes to`'manual'`

.

Was this topic helpful?