Axes.set_ylim(self, bottom=None, top=None, emit=True, auto=False, *, ymin=None, ymax=None)
Set the y-axis view limits.
Parameters: |
|
---|---|
Returns: |
|
See also
get_ylim
set_ybound,
get_ybound
invert_yaxis,
yaxis_inverted
The bottom value may be greater than the top value, in which case the y-axis values will decrease from bottom to top.
>>> set_ylim(bottom, top) >>> set_ylim((bottom, top)) >>> bottom, top = set_ylim(bottom, top)
One limit may be left unchanged.
>>> set_ylim(top=top_lim)
Limits may be passed in reverse order to flip the direction of the y-axis. For example, suppose y
represents depth of the ocean in m. The y-axis limits might be set like the following so 5000 m depth is at the bottom of the plot and the surface, 0 m, is at the top.
>>> set_ylim(5000, 0)
matplotlib.axes.Axes.set_ylim
© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.axes.Axes.set_ylim.html