Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e4178d8

Browse files
committed
Improve a few docstrings.
1 parent a305776 commit e4178d8

File tree

1 file changed

+20
-39
lines changed

1 file changed

+20
-39
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,9 +1612,7 @@ def axis(self, *v, **kwargs):
16121612
return v
16131613

16141614
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."""
16181616
return self.legend_
16191617

16201618
def get_images(self):
@@ -1626,30 +1624,30 @@ def get_lines(self):
16261624
return cbook.silent_list('Line2D', self.lines)
16271625

16281626
def get_xaxis(self):
1629-
"""Return the XAxis instance"""
1627+
"""Return the XAxis instance."""
16301628
return self.xaxis
16311629

16321630
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."""
16341632
return cbook.silent_list('Line2D xgridline',
16351633
self.xaxis.get_gridlines())
16361634

16371635
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',
16401638
self.xaxis.get_ticklines())
16411639

16421640
def get_yaxis(self):
1643-
"""Return the YAxis instance"""
1641+
"""Return the YAxis instance."""
16441642
return self.yaxis
16451643

16461644
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."""
16481646
return cbook.silent_list('Line2D ygridline',
16491647
self.yaxis.get_gridlines())
16501648

16511649
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."""
16531651
return cbook.silent_list('Line2D ytickline',
16541652
self.yaxis.get_ticklines())
16551653

@@ -2746,27 +2744,16 @@ def set_axis_bgcolor(self, color):
27462744
# data limits, ticks, tick labels, and formatting
27472745

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

27532750
def xaxis_inverted(self):
2754-
"""Returns *True* if the x-axis is inverted."""
2751+
"""Return whether the x-axis is inverted."""
27552752
left, right = self.get_xlim()
27562753
return right < left
27572754

27582755
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."""
27702757
left, right = self.get_xlim()
27712758
if left < right:
27722759
return left, right
@@ -3002,7 +2989,7 @@ def set_xticks(self, ticks, minor=False):
30022989

30032990
def get_xmajorticklabels(self):
30042991
"""
3005-
Get the xtick major labels
2992+
Get the major x tick labels.
30062993
30072994
Returns
30082995
-------
@@ -3014,7 +3001,7 @@ def get_xmajorticklabels(self):
30143001

30153002
def get_xminorticklabels(self):
30163003
"""
3017-
Get the x minor tick labels
3004+
Get the minor x tick labels.
30183005
30193006
Returns
30203007
-------
@@ -3086,22 +3073,16 @@ def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs):
30863073
return ret
30873074

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

30953079
def yaxis_inverted(self):
3096-
"""Returns *True* if the y-axis is inverted."""
3080+
"""Return whether the y-axis is inverted."""
30973081
bottom, top = self.get_ylim()
30983082
return top < bottom
30993083

31003084
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."""
31053086
bottom, top = self.get_ylim()
31063087
if bottom < top:
31073088
return bottom, top
@@ -3316,7 +3297,7 @@ def set_yticks(self, ticks, minor=False):
33163297

33173298
def get_ymajorticklabels(self):
33183299
"""
3319-
Get the major y tick labels
3300+
Get the major y tick labels.
33203301
33213302
Returns
33223303
-------
@@ -3328,7 +3309,7 @@ def get_ymajorticklabels(self):
33283309

33293310
def get_yminorticklabels(self):
33303311
"""
3331-
Get the minor y tick labels
3312+
Get the minor y tick labels.
33323313
33333314
Returns
33343315
-------

0 commit comments

Comments
 (0)