@@ -1612,9 +1612,7 @@ def axis(self, *v, **kwargs):
1612
1612
return v
1613
1613
1614
1614
def get_legend (self ):
1615
- """
1616
- Return the legend.Legend instance, or None if no legend is defined
1617
- """
1615
+ """Return the `Legend` instance, or None if no legend is defined."""
1618
1616
return self .legend_
1619
1617
1620
1618
def get_images (self ):
@@ -1626,30 +1624,30 @@ def get_lines(self):
1626
1624
return cbook .silent_list ('Line2D' , self .lines )
1627
1625
1628
1626
def get_xaxis (self ):
1629
- """Return the XAxis instance"""
1627
+ """Return the XAxis instance. """
1630
1628
return self .xaxis
1631
1629
1632
1630
def get_xgridlines (self ):
1633
- """Get the x grid lines as a list of Line2D instances"""
1631
+ """Get the x grid lines as a list of ` Line2D` instances. """
1634
1632
return cbook .silent_list ('Line2D xgridline' ,
1635
1633
self .xaxis .get_gridlines ())
1636
1634
1637
1635
def get_xticklines (self ):
1638
- """Get the xtick lines as a list of Line2D instances"""
1639
- return cbook .silent_list ('Text xtickline' ,
1636
+ """Get the x tick lines as a list of ` Line2D` instances. """
1637
+ return cbook .silent_list ('Line2D xtickline' ,
1640
1638
self .xaxis .get_ticklines ())
1641
1639
1642
1640
def get_yaxis (self ):
1643
- """Return the YAxis instance"""
1641
+ """Return the YAxis instance. """
1644
1642
return self .yaxis
1645
1643
1646
1644
def get_ygridlines (self ):
1647
- """Get the y grid lines as a list of Line2D instances"""
1645
+ """Get the y grid lines as a list of ` Line2D` instances. """
1648
1646
return cbook .silent_list ('Line2D ygridline' ,
1649
1647
self .yaxis .get_gridlines ())
1650
1648
1651
1649
def get_yticklines (self ):
1652
- """Get the ytick lines as a list of Line2D instances"""
1650
+ """Get the y tick lines as a list of ` Line2D` instances. """
1653
1651
return cbook .silent_list ('Line2D ytickline' ,
1654
1652
self .yaxis .get_ticklines ())
1655
1653
@@ -2746,27 +2744,16 @@ def set_axis_bgcolor(self, color):
2746
2744
# data limits, ticks, tick labels, and formatting
2747
2745
2748
2746
def invert_xaxis (self ):
2749
- "Invert the x-axis."
2750
- left , right = self .get_xlim ()
2751
- self .set_xlim (right , left , auto = None )
2747
+ """Invert the x-axis."""
2748
+ self .set_xlim (self .get_xlim ()[::- 1 ], auto = None )
2752
2749
2753
2750
def xaxis_inverted (self ):
2754
- """Returns *True* if the x-axis is inverted."""
2751
+ """Return whether the x-axis is inverted."""
2755
2752
left , right = self .get_xlim ()
2756
2753
return right < left
2757
2754
2758
2755
def get_xbound (self ):
2759
- """Returns the x-axis numerical bounds
2760
-
2761
- This always returns::
2762
-
2763
- lowerBound < upperBound
2764
-
2765
- Returns
2766
- -------
2767
- lowerBound, upperBound : float
2768
-
2769
- """
2756
+ """Return the lower and upper x-axis bounds, in increasing order."""
2770
2757
left , right = self .get_xlim ()
2771
2758
if left < right :
2772
2759
return left , right
@@ -3002,7 +2989,7 @@ def set_xticks(self, ticks, minor=False):
3002
2989
3003
2990
def get_xmajorticklabels (self ):
3004
2991
"""
3005
- Get the xtick major labels
2992
+ Get the major x tick labels.
3006
2993
3007
2994
Returns
3008
2995
-------
@@ -3014,7 +3001,7 @@ def get_xmajorticklabels(self):
3014
3001
3015
3002
def get_xminorticklabels (self ):
3016
3003
"""
3017
- Get the x minor tick labels
3004
+ Get the minor x tick labels.
3018
3005
3019
3006
Returns
3020
3007
-------
@@ -3086,22 +3073,16 @@ def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs):
3086
3073
return ret
3087
3074
3088
3075
def invert_yaxis (self ):
3089
- """
3090
- Invert the y-axis.
3091
- """
3092
- bottom , top = self .get_ylim ()
3093
- self .set_ylim (top , bottom , auto = None )
3076
+ """Invert the y-axis."""
3077
+ self .set_ylim (self .get_ylim ()[::- 1 ], auto = None )
3094
3078
3095
3079
def yaxis_inverted (self ):
3096
- """Returns *True* if the y-axis is inverted."""
3080
+ """Return whether the y-axis is inverted."""
3097
3081
bottom , top = self .get_ylim ()
3098
3082
return top < bottom
3099
3083
3100
3084
def get_ybound (self ):
3101
- """
3102
- Return y-axis numerical bounds in the form of
3103
- ``lowerBound < upperBound``
3104
- """
3085
+ """Return the lower and upper y-axis bounds, in increasing order."""
3105
3086
bottom , top = self .get_ylim ()
3106
3087
if bottom < top :
3107
3088
return bottom , top
@@ -3316,7 +3297,7 @@ def set_yticks(self, ticks, minor=False):
3316
3297
3317
3298
def get_ymajorticklabels (self ):
3318
3299
"""
3319
- Get the major y tick labels
3300
+ Get the major y tick labels.
3320
3301
3321
3302
Returns
3322
3303
-------
@@ -3328,7 +3309,7 @@ def get_ymajorticklabels(self):
3328
3309
3329
3310
def get_yminorticklabels (self ):
3330
3311
"""
3331
- Get the minor y tick labels
3312
+ Get the minor y tick labels.
3332
3313
3333
3314
Returns
3334
3315
-------
0 commit comments