@@ -1751,7 +1751,7 @@ def ylim(*args, **kwargs):
17511751 return ret
17521752
17531753
1754- def xticks (ticks = None , labels = None , ** kwargs ):
1754+ def xticks (ticks = None , labels = None , * , minor = False , * *kwargs ):
17551755 """
17561756 Get or set the current tick locations and labels of the x-axis.
17571757
@@ -1764,6 +1764,9 @@ def xticks(ticks=None, labels=None, **kwargs):
17641764 labels : array-like, optional
17651765 The labels to place at the given *ticks* locations. This argument can
17661766 only be passed if *ticks* is passed as well.
1767+ minor : bool, default: False
1768+ If ``False``, get/set the major ticks/labels; if ``True``, the minor
1769+ ticks/labels.
17671770 **kwargs
17681771 `.Text` properties can be used to control the appearance of the labels.
17691772
@@ -1794,24 +1797,24 @@ def xticks(ticks=None, labels=None, **kwargs):
17941797 ax = gca ()
17951798
17961799 if ticks is None :
1797- locs = ax .get_xticks ()
1800+ locs = ax .get_xticks (minor = minor )
17981801 if labels is not None :
17991802 raise TypeError ("xticks(): Parameter 'labels' can't be set "
18001803 "without setting 'ticks'" )
18011804 else :
1802- locs = ax .set_xticks (ticks )
1805+ locs = ax .set_xticks (ticks , minor = minor )
18031806
18041807 if labels is None :
1805- labels = ax .get_xticklabels ()
1808+ labels = ax .get_xticklabels (minor = minor )
18061809 for l in labels :
18071810 l ._internal_update (kwargs )
18081811 else :
1809- labels = ax .set_xticklabels (labels , ** kwargs )
1812+ labels = ax .set_xticklabels (labels , minor = minor , ** kwargs )
18101813
18111814 return locs , labels
18121815
18131816
1814- def yticks (ticks = None , labels = None , ** kwargs ):
1817+ def yticks (ticks = None , labels = None , * , minor = False , * *kwargs ):
18151818 """
18161819 Get or set the current tick locations and labels of the y-axis.
18171820
@@ -1824,6 +1827,9 @@ def yticks(ticks=None, labels=None, **kwargs):
18241827 labels : array-like, optional
18251828 The labels to place at the given *ticks* locations. This argument can
18261829 only be passed if *ticks* is passed as well.
1830+ minor : bool, default: False
1831+ If ``False``, get/set the major ticks/labels; if ``True``, the minor
1832+ ticks/labels.
18271833 **kwargs
18281834 `.Text` properties can be used to control the appearance of the labels.
18291835
@@ -1854,19 +1860,19 @@ def yticks(ticks=None, labels=None, **kwargs):
18541860 ax = gca ()
18551861
18561862 if ticks is None :
1857- locs = ax .get_yticks ()
1863+ locs = ax .get_yticks (minor = minor )
18581864 if labels is not None :
18591865 raise TypeError ("yticks(): Parameter 'labels' can't be set "
18601866 "without setting 'ticks'" )
18611867 else :
1862- locs = ax .set_yticks (ticks )
1868+ locs = ax .set_yticks (ticks , minor = minor )
18631869
18641870 if labels is None :
1865- labels = ax .get_yticklabels ()
1871+ labels = ax .get_yticklabels (minor = minor )
18661872 for l in labels :
18671873 l ._internal_update (kwargs )
18681874 else :
1869- labels = ax .set_yticklabels (labels , ** kwargs )
1875+ labels = ax .set_yticklabels (labels , minor = minor , ** kwargs )
18701876
18711877 return locs , labels
18721878
0 commit comments