Home

setylim

Setylim is a function used in plotting libraries, most commonly as a method of an axes object in Matplotlib, to specify the lower and upper limits of the y-axis for a given plot. It does not change the underlying data; it only controls the portion of the vertical range that is displayed.

In practice, setylim is called on an axes instance, for example as ax.set_ylim(0, 100) or ax.set_ylim([0, 100]).

This function is useful for zooming in on a particular data range, ensuring consistent y-axis scales across

In Matplotlib, setylim is the object-oriented interface equivalent to the pyplot function ylim, which applies to

Notes: setylim is a term associated with Python’s Matplotlib and similar APIs. In MATLAB, the comparable operation

Passing
None
for
a
bound
can
allow
that
bound
to
be
determined
automatically
by
the
plotting
library.
When
explicit
limits
are
set,
the
axis
is
fixed
to
that
range
and
automatic
rescaling
of
the
y-axis
is
typically
disabled
until
autoscale
is
invoked
again.
multiple
subplots
for
comparison,
or
preparing
figures
for
publication
where
a
standard
axis
range
is
required.
After
setting
limits,
data
outside
the
specified
range
is
clipped
from
the
visible
area,
though
it
remains
part
of
the
dataset.
the
current
axes.
The
two
forms
are
interchangeable
in
common
workflows:
ax.set_ylim(...)
and
plt.ylim(...).
Setylim
is
distinct
from
setting
x-axis
limits
(set_xlim)
and
is
often
used
in
conjunction
with
other
axis
controls
(such
as
autoscale,
axis
aspect,
and
tick
methods)
to
fine-tune
the
figure’s
presentation.
is
performed
by
ylim([ymin
ymax]),
not
by
a
setylim
function.