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

Skip to content

Commit e141bec

Browse files
committed
Fix doc for set_{x,y}label, and then some more.
The previous wording of the "see also: text" was a bit confused. As it turns out `text()` doesn't actually list the supported properties, but if there's *one* axes method where it makes sense to list them, it's there... (I don't think set_xlabel needs to dupe the list of properties; a "see also: text" seems enough.)
1 parent 8990a43 commit e141bec

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def set_xlabel(self, xlabel, fontdict=None, labelpad=None, *,
213213
214214
See also
215215
--------
216-
text : for information on how override and the optional arguments work
216+
text : Documents the properties supported by `.Text`.
217217
"""
218218
if labelpad is not None:
219219
self.xaxis.labelpad = labelpad
@@ -266,7 +266,7 @@ def set_ylabel(self, ylabel, fontdict=None, labelpad=None, *,
266266
267267
See also
268268
--------
269-
text : for information on how override and the optional arguments work
269+
text : Documents the properties supported by `.Text`.
270270
"""
271271
if labelpad is not None:
272272
self.yaxis.labelpad = labelpad
@@ -689,6 +689,7 @@ def secondary_yaxis(self, location, *, functions=None, **kwargs):
689689
raise ValueError('secondary_yaxis location must be either '
690690
'a float or "left"/"right"')
691691

692+
@docstring.dedent_interpd
692693
def text(self, x, y, s, fontdict=None, **kwargs):
693694
"""
694695
Add text to the axes.
@@ -719,6 +720,8 @@ def text(self, x, y, s, fontdict=None, **kwargs):
719720
**kwargs : `~matplotlib.text.Text` properties.
720721
Other miscellaneous text parameters.
721722
723+
%(Text)s
724+
722725
Examples
723726
--------
724727
Individual keyword arguments can be used to override any given

lib/matplotlib/axes/_secondary_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def set_xlabel(self, xlabel, fontdict=None, labelpad=None, **kwargs):
316316
317317
See also
318318
--------
319-
text : for information on how override and the optional args work
319+
text : Documents the properties supported by `.Text`.
320320
"""
321321
if labelpad is not None:
322322
self.xaxis.labelpad = labelpad
@@ -341,7 +341,7 @@ def set_ylabel(self, ylabel, fontdict=None, labelpad=None, **kwargs):
341341
342342
See also
343343
--------
344-
text : for information on how override and the optional args work
344+
text : Documents the properties supported by `.Text`.
345345
"""
346346
if labelpad is not None:
347347
self.yaxis.labelpad = labelpad

0 commit comments

Comments
 (0)