ylim

Syntax

Description

ylim(limits) sets
the y-axis limits for the current axes. Specify limits as
a two-element vector of the form [ymin ymax], where ymax is
a numeric value greater than ymin.

ylim auto lets the axes choose the y-axis
limits. The axes chooses limits that span the range of the plotted
data. This command sets the YLimMode property for
the axes to 'auto'.

ylim manual freezes 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'.

m = ylim('mode') returns
the current value of the limits mode, which is either 'auto' or 'manual'.
By default, the mode is automatic unless you specify limits or set
the mode to manual.

___ = ylim(ax,___) uses
the axes specified by ax instead of the current
axes. Specify an axes with any of the input or output arguments in
previous syntaxes. Use single quotes around input arguments that are
character strings, for example, ylim(ax,'auto') and ylim(ax,'manual').

Input Arguments

Minimum and maximum limits, specified as a two-element vector
of the form [ymin ymax]. Specifying the y-axis
limits sets the y-axis limits mode to manual.
The YLim and YLimMode properties
for the corresponding axes store the y-axis limits
and the limits mode, respectively.

Changing the y-axis limits can cause other
limits to change, unless their corresponding mode properties are set
to manual.