@@ -2804,7 +2804,7 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw):
2804
2804
emit : bool, optional
2805
2805
Whether to notify observers of limit change (default: True).
2806
2806
2807
- auto : {True, False, None} , optional
2807
+ auto : bool or None, optional
2808
2808
Whether to turn on autoscaling of the x-axis. True turns on,
2809
2809
False turns off (default action), Non
10000
e leaves unchanged.
2810
2810
@@ -2834,10 +2834,11 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw):
2834
2834
2835
2835
>>> set_xlim(right=right_lim)
2836
2836
2837
- Limits may be passed in reverse order. For example, suppose `x`
2838
- represents the number of years before present. The x-axis limits
2839
- might be set like the following so 5000 years ago is on the left
2840
- of the plot and the present is on the right.
2837
+ Limits may be passed in reverse order to flip the direction of
2838
+ the x-axis. For example, suppose `x` represents the number of
2839
+ years before present. The x-axis limits might be set like the
2840
+ following so 5000 years ago is on the left of the plot and the
2841
+ present is on the right.
2841
2842
2842
2843
>>> set_xlim(5000, 0)
2843
2844
@@ -3058,43 +3059,60 @@ def get_ylim(self):
3058
3059
3059
3060
def set_ylim (self , bottom = None , top = None , emit = True , auto = False , ** kw ):
3060
3061
"""
3061
- Set the data limits for the yaxis
3062
+ Set the data limits for the y-axis
3062
3063
3063
- Examples::
3064
+ Parameters
3065
+ ----------
3066
+ bottom : scalar, optional
3067
+ The bottom ylim (default: None, which leaves the bottom
3068
+ limit unchanged). The previous name `ymin` may be used
3069
+ instead.
3064
3070
3065
- set_ylim((bottom, top))
3066
- set_ylim(bottom, top)
3067
- set_ylim(bottom=1) # top unchanged
3068
- set_ylim(top=1) # bottom unchanged
3071
+ top : scalar, optional
3072
+ The top ylim (default: None, which leaves the top limit
3073
+ unchanged). The previous name `ymax` may be used instead.
3069
3074
3070
- Keyword arguments:
3075
+ emit : bool, optional
3076
+ Whether to notify observers of limit change (default: True).
3071
3077
3072
- *bottom*: scalar
3073
- The bottom ylim; the previous name, *ymin*, may still be used
3078
+ auto : bool or None, optional
3079
+ Whether to turn on autoscaling of the y-axis. True turns on,
3080
+ False turns off (default action), None leaves unchanged.
3074
3081
3075
- *top*: scalar
3076
- The top ylim; the previous name, *ymax*, may still be used
3082
+ ylimits : tuple, optional
3083
+ The bottom and top yxlims may be passed as the tuple
3084
+ (`bottom`, `top`) as the first positional argument (or as
3085
+ the `bottom` keyword argument).
3077
3086
3078
- *emit*: [ *True* | *False* ]
3079
- Notify observers of limit change
3087
+ Returns
3088
+ -------
3089
+ ylimits : tuple
3090
+ Returns the current y-axis limits, reflecting any changes
3091
+ made by this call, as (`bottom`, `top`).
3080
3092
3081
- *auto*: [ *True* | *False* | *None* ]
3082
- Turn *y* autoscaling on (*True*), off (*False*; default),
3083
- or leave unchanged (*None*)
3093
+ Notes
3094
+ -----
3095
+ The `bottom` value may be greater than the `top` value, in which
3096
+ case the y-axis values will decrease from bottom to top.
3084
3097
3085
- Note, the *bottom* (formerly *ymin*) value may be greater than
3086
- the *top* (formerly *ymax*).
3087
- For example, suppose *y* is depth in the ocean.
3088
- Then one might use::
3098
+ Examples
3099
+ --------
3100
+ >>> set_ylim(bottom, top)
3101
+ >>> set_ylim((bottom, top))
3102
+ >>> bottom, top = set_ylim(bottom, top)
3103
+
3104
+ One limit may be left unchanged.
3089
3105
3090
- set_ylim(5000, 0 )
3106
+ >>> set_ylim(top=top_lim )
3091
3107
3092
- so 5000 m depth is at the bottom of the plot and the
3093
- surface, 0 m, is at the top.
3108
+ Limits may be passed in reverse order to flip the direction of
3109
+ the y-axis. For example, suppose `y` represents depth of the
3110
+ ocean in m. The y-axis limits might be set like the following
3111
+ so 5000 m depth is at the bottom of the plot and the surface,
3112
+ 0 m, is at the top.
3094
3113
3095
- Returns the current ylimits as a length 2 tuple
3114
+ >>> set_ylim(5000, 0)
3096
3115
3097
- ACCEPTS: length 2 sequence of floats
3098
3116
"""
3099
3117
if 'ymin' in kw :
3100
3118
bottom = kw .pop ('ymin' )
0 commit comments