MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_ylim

Method set_ylim

lib/matplotlib/axes/_base.py:4143–4219  ·  view source on GitHub ↗

Set the y-axis view limits. Parameters ---------- bottom : float, optional The bottom ylim in data coordinates. Passing *None* leaves the limit unchanged. The bottom and top ylims may also be passed as the tuple (*bot

(self, bottom=None, top=None, *, emit=True, auto=False,
                 ymin=None, ymax=None)

Source from the content-addressed store, hash-verified

4141 return tuple(self.viewLim.intervaly)
4142
4143 def set_ylim(self, bottom=None, top=None, *, emit=True, auto=False,
4144 ymin=None, ymax=None):
4145 """
4146 Set the y-axis view limits.
4147
4148 Parameters
4149 ----------
4150 bottom : float, optional
4151 The bottom ylim in data coordinates. Passing *None* leaves the
4152 limit unchanged.
4153
4154 The bottom and top ylims may also be passed as the tuple
4155 (*bottom*, *top*) as the first positional argument (or as
4156 the *bottom* keyword argument).
4157
4158 .. ACCEPTS: (bottom: float, top: float)
4159
4160 top : float, optional
4161 The top ylim in data coordinates. Passing *None* leaves the
4162 limit unchanged.
4163
4164 emit : bool, default: True
4165 Whether to notify observers of limit change.
4166
4167 auto : bool or None, default: False
4168 Whether to turn on autoscaling of the y-axis. *True* turns on,
4169 *False* turns off, *None* leaves unchanged.
4170
4171 ymin, ymax : float, optional
4172 They are equivalent to bottom and top respectively, and it is an
4173 error to pass both *ymin* and *bottom* or *ymax* and *top*.
4174
4175 Returns
4176 -------
4177 bottom, top : (float, float)
4178 The new y-axis limits in data coordinates.
4179
4180 See Also
4181 --------
4182 get_ylim
4183 set_ybound, get_ybound
4184 invert_yaxis, yaxis_inverted
4185
4186 Notes
4187 -----
4188 The *bottom* value may be greater than the *top* value, in which
4189 case the y-axis values will decrease from *bottom* to *top*.
4190
4191 Examples
4192 --------
4193 >>> set_ylim(bottom, top)
4194 >>> set_ylim((bottom, top))
4195 >>> bottom, top = set_ylim(bottom, top)
4196
4197 One limit may be left unchanged.
4198
4199 >>> set_ylim(top=top_lim)
4200

Callers 15

shareyMethod · 0.95
axisMethod · 0.95
set_yboundMethod · 0.95
drag_panMethod · 0.95
set_extentMethod · 0.45
_draw_allMethod · 0.45
__init__Method · 0.45
ylimFunction · 0.45
scroll_handlerFunction · 0.45
demoMethod · 0.45
demoMethod · 0.45
set_rlimMethod · 0.45

Calls 1

_set_limMethod · 0.80

Tested by 15

test_date_axhspanFunction · 0.36
test_date_axhlineFunction · 0.36
test_date_inverted_limitFunction · 0.36
test_rasterized_orderingFunction · 0.36
plot_pathsFunction · 0.36
test_clippingFunction · 0.36
test_diamondFunction · 0.36
test_simplify_curveFunction · 0.36
test_hatchFunction · 0.36