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)
| 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 |