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

Method set_xlim

lib/matplotlib/axes/_base.py:3894–3970  ·  view source on GitHub ↗

Set the x-axis view limits. Parameters ---------- left : float, optional The left xlim in data coordinates. Passing *None* leaves the limit unchanged. The left and right xlims may also be passed as the tuple (*left*,

(self, left=None, right=None, *, emit=True, auto=False,
                 xmin=None, xmax=None)

Source from the content-addressed store, hash-verified

3892 return converted_limit
3893
3894 def set_xlim(self, left=None, right=None, *, emit=True, auto=False,
3895 xmin=None, xmax=None):
3896 """
3897 Set the x-axis view limits.
3898
3899 Parameters
3900 ----------
3901 left : float, optional
3902 The left xlim in data coordinates. Passing *None* leaves the
3903 limit unchanged.
3904
3905 The left and right xlims may also be passed as the tuple
3906 (*left*, *right*) as the first positional argument (or as
3907 the *left* keyword argument).
3908
3909 .. ACCEPTS: (left: float, right: float)
3910
3911 right : float, optional
3912 The right xlim in data coordinates. Passing *None* leaves the
3913 limit unchanged.
3914
3915 emit : bool, default: True
3916 Whether to notify observers of limit change.
3917
3918 auto : bool or None, default: False
3919 Whether to turn on autoscaling of the x-axis. True turns on,
3920 False turns off, None leaves unchanged.
3921
3922 xmin, xmax : float, optional
3923 They are equivalent to left and right respectively, and it is an
3924 error to pass both *xmin* and *left* or *xmax* and *right*.
3925
3926 Returns
3927 -------
3928 left, right : (float, float)
3929 The new x-axis limits in data coordinates.
3930
3931 See Also
3932 --------
3933 get_xlim
3934 set_xbound, get_xbound
3935 invert_xaxis, xaxis_inverted
3936
3937 Notes
3938 -----
3939 The *left* value may be greater than the *right* value, in which
3940 case the x-axis values will decrease from left to right.
3941
3942 Examples
3943 --------
3944 >>> set_xlim(left, right)
3945 >>> set_xlim((left, right))
3946 >>> left, right = set_xlim(left, right)
3947
3948 One limit may be left unchanged.
3949
3950 >>> set_xlim(right=right_lim)
3951

Callers 15

sharexMethod · 0.95
axisMethod · 0.95
set_xboundMethod · 0.95
drag_panMethod · 0.95
set_extentMethod · 0.45
_draw_allMethod · 0.45
__init__Method · 0.45
xlimFunction · 0.45
scroll_handlerFunction · 0.45
demoMethod · 0.45
spyMethod · 0.45
test_date_axvspanFunction · 0.45

Calls 1

_set_limMethod · 0.80

Tested by 15

test_date_axvspanFunction · 0.36
test_date_axvlineFunction · 0.36
test_too_many_date_ticksFunction · 0.36
test_offset_changesFunction · 0.36
test_rasterized_orderingFunction · 0.36
plot_pathsFunction · 0.36
test_overflowFunction · 0.36
test_diamondFunction · 0.36
test_simplify_curveFunction · 0.36