Axes.set_xlim(self, left=None, right=None, emit=True, auto=False, *, xmin=None, xmax=None)
Set the xaxis view limits.
Parameters: 


Returns: 

See also
get_xlim
set_xbound,
get_xbound
invert_xaxis,
xaxis_inverted
The left value may be greater than the right value, in which case the xaxis values will decrease from left to right.
>>> set_xlim(left, right) >>> set_xlim((left, right)) >>> left, right = set_xlim(left, right)
One limit may be left unchanged.
>>> set_xlim(right=right_lim)
Limits may be passed in reverse order to flip the direction of the xaxis. For example, suppose x represents the number of years before present. The xaxis limits might be set like the following so 5000 years ago is on the left of the plot and the present is on the right.
>>> set_xlim(5000, 0)
matplotlib.axes.Axes.set_xlim
© 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_xlim.html