Skip to content

Commit b14dc23

Browse files
QuLogicmeeseeksmachine
authored andcommitted
Backport PR #28459: DOC: Document kwargs scope for tick setter functions
1 parent 645e4ac commit b14dc23

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
@@ -2170,6 +2170,21 @@ def xticks(
21702170
**kwargs
21712171
`.Text` properties can be used to control the appearance of the labels.
21722172
2173+
.. warning::
2174+
2175+
This only sets the properties of the current ticks, which is
2176+
only sufficient if you either pass *ticks*, resulting in a
2177+
fixed list of ticks, or if the plot is static.
2178+
2179+
Ticks are not guaranteed to be persistent. Various operations
2180+
can create, delete and modify the Tick instances. There is an
2181+
imminent risk that these settings can get lost if you work on
2182+
the figure further (including also panning/zooming on a
2183+
displayed figure).
2184+
2185+
Use `~.pyplot.tick_params` instead if possible.
2186+
2187+
21732188
Returns
21742189
-------
21752190
locs
@@ -2241,6 +2256,20 @@ def yticks(
22412256
**kwargs
22422257
`.Text` properties can be used to control the appearance of the labels.
22432258
2259+
.. warning::
2260+
2261+
This only sets the properties of the current ticks, which is
2262+
only sufficient if you either pass *ticks*, resulting in a
2263+
fixed list of ticks, or if the plot is static.
2264+
2265+
Ticks are not guaranteed to be persistent. Various operations
2266+
can create, delete and modify the Tick instances. There is an
2267+
imminent risk that these settings can get lost if you work on
2268+
the figure further (including also panning/zooming on a
2269+
displayed figure).
2270+
2271+
Use `~.pyplot.tick_params` instead if possible.
2272+
22442273
Returns
22452274
-------
22462275
locs

0 commit comments

Comments
 (0)