@@ -1539,9 +1539,11 @@ def convert_units(self, x):
15391539
15401540 def set_units (self , u ):
15411541 """
1542- set the units for axis
1542+ Set the units for axis.
15431543
1544- ACCEPTS: a units tag
1544+ Parameters
1545+ ----------
1546+ u : units tag
15451547 """
15461548 pchanged = False
15471549 if u is None :
@@ -1558,14 +1560,21 @@ def set_units(self, u):
15581560 self .stale = True
15591561
15601562 def get_units (self ):
1561- 'return the units for axis'
1563+ """Return the units for axis."""
15621564 return self .units
15631565
15641566 def set_label_text (self , label , fontdict = None , ** kwargs ):
15651567 """
15661568 Set the text value of the axis label.
15671569
1568- ACCEPTS: A string value for the label
1570+ Parameters
1571+ ----------
1572+ label : str
1573+ Text string.
1574+ fontdict : dict
1575+ Text properties.
1576+ **kwargs :
1577+ Merged into fontdict.
15691578 """
15701579 self .isDefault_label = False
15711580 self .label .set_text (label )
@@ -1601,7 +1610,7 @@ def set_minor_formatter(self, formatter):
16011610 """
16021611 if not isinstance (formatter , mticker .Formatter ):
16031612 raise TypeError ("formatter argument should be instance of "
1604- "matplotlib.ticker.Formatter" )
1613+ "matplotlib.ticker.Formatter" )
16051614 self .isDefault_minfmt = False
16061615 self .minor .formatter = formatter
16071616 formatter .set_axis (self )
@@ -1617,7 +1626,7 @@ def set_major_locator(self, locator):
16171626 """
16181627 if not isinstance (locator , mticker .Locator ):
16191628 raise TypeError ("formatter argument should be instance of "
1620- "matplotlib.ticker.Locator" )
1629+ "matplotlib.ticker.Locator" )
16211630 self .isDefault_majloc = False
16221631 self .major .locator = locator
16231632 locator .set_axis (self )
@@ -1633,7 +1642,7 @@ def set_minor_locator(self, locator):
16331642 """
16341643 if not isinstance (locator , mticker .Locator ):
16351644 raise TypeError ("formatter argument should be instance of "
1636- "matplotlib.ticker.Locator" )
1645+ "matplotlib.ticker.Locator" )
16371646 self .isDefault_minloc = False
16381647 self .minor .locator = locator
16391648 locator .set_axis (self )
@@ -1651,21 +1660,29 @@ def set_pickradius(self, pickradius):
16511660
16521661 def set_ticklabels (self , ticklabels , * args , minor = False , ** kwargs ):
16531662 """
1654- Set the text values of the tick labels. Return a list of Text
1655- instances. Use *kwarg* *minor=True* to select minor ticks.
1656- All other kwargs are used to update the text object properties.
1657- As for get_ticklabels, label1 (left or bottom) is
1658- affected for a given tick only if its label1On attribute
1659- is True, and similarly for label2. The list of returned
1660- label text objects consists of all such label1 objects followed
1661- by all such label2 objects.
1663+ Set the text values of the tick labels.
16621664
1663- The input *ticklabels* is assumed to match the set of
1664- tick locations, regardless of the state of label1On and
1665- label2On.
1665+ Parameters
1666+ ----------
1667+ ticklabels : sequence of str or of `Text`\s
1668+ List of texts for tick labels; must include values for non-visible
1669+ labels.
1670+ minor : bool
1671+ If True, set minor ticks instead of major ticks.
1672+ **kwargs
1673+ Text properties.
16661674
1667- ACCEPTS: sequence of strings or Text objects
1668- """
1675+ Returns
1676+ -------
1677+ labels : list of `Text`\s
1678+ For each tick, includes ``tick.label1`` if it is visible, then
1679+ ``tick.label2`` if it is visible, in that order.
1680+ """
1681+ if args :
1682+ cbook .warn_deprecated (
1683+ "3.1" , "Additional positional arguments to set_ticklabels are "
1684+ "ignored, and deprecated since Matplotlib 3.1; passing them "
1685+ "will raise a TypeError in Matplotlib 3.3." )
16691686 get_labels = []
16701687 for t in ticklabels :
16711688 # try calling get_text() to check whether it is Text object
@@ -1705,7 +1722,10 @@ def set_ticks(self, ticks, minor=False):
17051722 """
17061723 Set the locations of the tick marks from sequence ticks
17071724
1708- ACCEPTS: sequence of floats
1725+ Parameters
1726+ ----------
1727+ ticks : sequence of floats
1728+ minor : bool
17091729 """
17101730 # XXX if the user changes units, the information will be lost here
17111731 ticks = self .convert_units (ticks )
0 commit comments