Skip to content

Commit

Permalink
DOC: Document kwargs scope for tick setter functions
Browse files Browse the repository at this point in the history
To clarify expectations c.f. matplotlib#23272 (comment)
  • Loading branch information
timhoffm committed Jun 25, 2024
1 parent 8b9cb14 commit a48cf02
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2028,7 +2028,9 @@ def set_ticklabels(self, labels, *, minor=False, fontdict=None, **kwargs):
.. warning::
This only sets the properties of the current ticks.
This only sets the properties of the current ticks, which is
only sufficient for static plots.
Ticks are not guaranteed to be persistent. Various operations
can create, delete and modify the Tick instances. There is an
imminent risk that these settings can get lost if you work on
Expand Down
29 changes: 29 additions & 0 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2182,6 +2182,21 @@ def xticks(
**kwargs
`.Text` properties can be used to control the appearance of the labels.
.. warning::
This only sets the properties of the current ticks, which is
only sufficient if you either pass *ticks*, resulting in a
fixed list of ticks, or if the plot is static.
Ticks are not guaranteed to be persistent. Various operations
can create, delete and modify the Tick instances. There is an
imminent risk that these settings can get lost if you work on
the figure further (including also panning/zooming on a
displayed figure).
Use `~.pyplot.tick_params` instead if possible.
Returns
-------
locs
Expand Down Expand Up @@ -2253,6 +2268,20 @@ def yticks(
**kwargs
`.Text` properties can be used to control the appearance of the labels.
.. warning::
This only sets the properties of the current ticks, which is
only sufficient if you either pass *ticks*, resulting in a
fixed list of ticks, or if the plot is static.
Ticks are not guaranteed to be persistent. Various operations
can create, delete and modify the Tick instances. There is an
imminent risk that these settings can get lost if you work on
the figure further (including also panning/zooming on a
displayed figure).
Use `~.pyplot.tick_params` instead if possible.
Returns
-------
locs
Expand Down

0 comments on commit a48cf02

Please sign in to comment.