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.

Set or query *z*-axis limits

`zlim(limits)`

`zl = zlim`

`zlim auto`

`zlim manual`

`m = zlim('mode')`

`___ = zlim(ax,___)`

`zlim(`

sets
the `limits`

)*z*-axis limits for the current axes. Specify `limits`

as
a two-element vector of the form `[zmin zmax]`

, where `zmax`

is
greater than `zmin`

.

`zlim auto`

sets an automatic mode, enabling
the axes to determine the *z*-axis limits. The
limits span the range of the plotted data. Use this option if you
change the limits and then want to set them back to the default values.
This command sets the `ZLimMode`

property for the
axes to `'auto'`

.

`zlim manual`

sets a manual mode, freezing the limits at
the current values. Use this option if you want to retain the current limits
when adding new data to the axes using the `hold on`

command.
This command sets the `ZLimMode`

property for the axes to
`'manual'`

.

returns
the current `m`

= zlim('mode')*z*-axis limits mode, which is either `'auto'`

or `'manual'`

.
By default, the mode is automatic unless you specify limits or set
the mode to manual.

`___ = zlim(`

uses the axes specified by `ax`

,___)`ax`

instead of the current axes.
Specify `ax`

as the first input argument for any of the
previous syntaxes. You can include an output argument if the original syntax
supports an output argument. Use single quotes around the mode inputs, for
example, `zlim(ax,'auto')`

.

The `zlim`

function sets and queries several
axes properties related to the *z*-axis limits.