@@ -1751,7 +1751,7 @@ def ylim(*args, **kwargs):
1751
1751
return ret
1752
1752
1753
1753
1754
- def xticks (ticks = None , labels = None , ** kwargs ):
1754
+ def xticks (ticks = None , labels = None , * , minor = False , * *kwargs ):
1755
1755
"""
1756
1756
Get or set the current tick locations and labels of the x-axis.
1757
1757
@@ -1764,6 +1764,9 @@ def xticks(ticks=None, labels=None, **kwargs):
1764
1764
labels : array-like, optional
1765
1765
The labels to place at the given *ticks* locations. This argument can
1766
1766
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.
1767
1770
**kwargs
1768
1771
`.Text` properties can be used to control the appearance of the labels.
1769
1772
@@ -1794,24 +1797,24 @@ def xticks(ticks=None, labels=None, **kwargs):
1794
1797
ax = gca ()
1795
1798
1796
1799
if ticks is None :
1797
- locs = ax .get_xticks ()
1800
+ locs = ax .get_xticks (minor = minor )
1798
1801
if labels is not None :
1799
1802
raise TypeError ("xticks(): Parameter 'labels' can't be set "
1800
1803
"without setting 'ticks'" )
1801
1804
else :
1802
- locs = ax .set_xticks (ticks )
1805
+ locs = ax .set_xticks (ticks , minor = minor )
1803
1806
1804
1807
if labels is None :
1805
- labels = ax .get_xticklabels ()
1808
+ labels = ax .get_xticklabels (minor = minor )
1806
1809
for l in labels :
1807
1810
l ._internal_update (kwargs )
1808
1811
else :
1809
- labels = ax .set_xticklabels (labels , ** kwargs )
1812
+ labels = ax .set_xticklabels (labels , minor = minor , ** kwargs )
1810
1813
1811
1814
return locs , labels
1812
1815
1813
1816
1814
- def yticks (ticks = None , labels = None , ** kwargs ):
1817
+ def yticks (ticks = None , labels = None , * , minor = False , * *kwargs ):
1815
1818
"""
1816
1819
Get or set the current tick locations and labels of the y-axis.
1817
1820
@@ -1824,6 +1827,9 @@ def yticks(ticks=None, labels=None, **kwargs):
1824
1827
labels : array-like, optional
1825
1828
The labels to place at the given *ticks* locations. This argument can
1826
1829
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.
1827
1833
**kwargs
1828
1834
`.Text` properties can be used to control the appearance of the labels.
1829
1835
@@ -1854,19 +1860,19 @@ def yticks(ticks=None, labels=None, **kwargs):
1854
1860
ax = gca ()
1855
1861
1856
1862
if ticks is None :
1857
- locs = ax .get_yticks ()
1863
+ locs = ax .get_yticks (minor = minor )
1858
1864
if labels is not None :
1859
1865
raise TypeError ("yticks(): Parameter 'labels' can't be set "
1860
1866
"without setting 'ticks'" )
1861
1867
else :
1862
- locs = ax .set_yticks (ticks )
1868
+ locs = ax .set_yticks (ticks , minor = minor )
1863
1869
1864
1870
if labels is None :
1865
- labels = ax .get_yticklabels ()
1871
+ labels = ax .get_yticklabels (minor = minor )
1866
1872
for l in labels :
1867
1873
l ._internal_update (kwargs )
1868
1874
else :
1869
- labels = ax .set_yticklabels (labels , ** kwargs )
1875
+ labels = ax .set_yticklabels (labels , minor = minor , ** kwargs )
1870
1876
1871
1877
return locs , labels
1872
1878
0 commit comments