Set or query y-axis limits
ylim(
sets the y-axis
limits for the current axes or chart. Specify limits
)limits
as a
two-element vector of the form [ymin ymax]
, where
ymax
is greater than ymin
.
ylim auto
sets an automatic mode, enabling
the axes to determine the y-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 YLimMode
property for the
axes to 'auto'
.
ylim 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 YLimMode
property for the axes to
'manual'
.
returns
the current y-axis limits mode, which is either m
= ylim('mode')'auto'
or 'manual'
.
By default, the mode is automatic unless you specify limits or set
the mode to manual.
___ = ylim(
uses the axes or chart specified by target
,___)target
instead of the
current axes. Specify target
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, ylim(target,'auto')
.
The ylim
function sets and queries several
axes properties related to the y-axis limits.