Skip to content

Commit f54dd51

Browse files
authored
Merge pull request #28459 from timhoffm/doc-tick-kwargs
DOC: Document kwargs scope for tick setter functions
2 parents 643df71 + a48cf02 commit f54dd51

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

lib/matplotlib/axis.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,9 @@ def set_ticklabels(self, labels, *, minor=False, fontdict=None, **kwargs):
20282028
20292029
.. warning::
20302030
2031-
This only sets the properties of the current ticks.
2031+
This only sets the properties of the current ticks, which is
2032+
only sufficient for static plots.
2033+
20322034
Ticks are not guaranteed to be persistent. Various operations
20332035
can create, delete and modify the Tick instances. There is an
20342036
imminent risk that these settings can get lost if you work on

lib/matplotlib/pyplot.py

+29
Original file line numberDiff line numberDiff line change
@@ -2182,6 +2182,21 @@ def xticks(
21822182
**kwargs
21832183
`.Text` properties can be used to control the appearance of the labels.
21842184
2185+
.. warning::
2186+
2187+
This only sets the properties of the current ticks, which is
2188+
only sufficient if you either pass *ticks*, resulting in a
2189+
fixed list of ticks, or if the plot is static.
2190+
2191+
Ticks are not guaranteed to be persistent. Various operations
2192+
can create, delete and modify the Tick instances. There is an
2193+
imminent risk that these settings can get lost if you work on
2194+
the figure further (including also panning/zooming on a
2195+
displayed figure).
2196+
2197+
Use `~.pyplot.tick_params` instead if possible.
2198+
2199+
21852200
Returns
21862201
-------
21872202
locs
@@ -2253,6 +2268,20 @@ def yticks(
22532268
**kwargs
22542269
`.Text` properties can be used to control the appearance of the labels.
22552270
2271+
.. warning::
2272+
2273+
This only sets the properties of the current ticks, which is
2274+
only sufficient if you either pass *ticks*, resulting in a
2275+
fixed list of ticks, or if the plot is static.
2276+
2277+
Ticks are not guaranteed to be persistent. Various operations
2278+
can create, delete and modify the Tick instances. There is an
2279+
imminent risk that these settings can get lost if you work on
2280+
the figure further (including also panning/zooming on a
2281+
displayed figure).
2282+
2283+
Use `~.pyplot.tick_params` instead if possible.
2284+
22562285
Returns
22572286
-------
22582287
locs

0 commit comments

Comments
 (0)