diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index aeee67e3816d..7cf9fc546736 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -619,6 +619,18 @@ class Axis(martist.Artist): The acceptance radius for containment tests. See also `.Axis.contains`. majorTicks : list of `.Tick` The major ticks. + + .. warning:: + + Ticks are not guaranteed to be persistent. Various operations + can create, delete and modify the Tick instances. There is an + imminent risk that changes to individual ticks will not + survive if you work on the figure further (including also + panning/zooming on a displayed figure). + + Working on the individual ticks is a method of last resort. + Use `.set_tick_params` instead if possible. + minorTicks : list of `.Tick` The minor ticks. """ @@ -1591,7 +1603,20 @@ def get_minor_formatter(self): return self.minor.formatter def get_major_ticks(self, numticks=None): - r"""Return the list of major `.Tick`\s.""" + r""" + Return the list of major `.Tick`\s. + + .. warning:: + + Ticks are not guaranteed to be persistent. Various operations + can create, delete and modify the Tick instances. There is an + imminent risk that changes to individual ticks will not + survive if you work on the figure further (including also + panning/zooming on a displayed figure). + + Working on the individual ticks is a method of last resort. + Use `.set_tick_params` instead if possible. + """ if numticks is None: numticks = len(self.get_majorticklocs()) @@ -1604,7 +1629,20 @@ def get_major_ticks(self, numticks=None): return self.majorTicks[:numticks] def get_minor_ticks(self, numticks=None): - r"""Return the list of minor `.Tick`\s.""" + r""" + Return the list of minor `.Tick`\s. + + .. warning:: + + Ticks are not guaranteed to be persistent. Various operations + can create, delete and modify the Tick instances. There is an + imminent risk that changes to individual ticks will not + survive if you work on the figure further (including also + panning/zooming on a displayed figure). + + Working on the individual ticks is a method of last resort. + Use `.set_tick_params` instead if possible. + """ if numticks is None: numticks = len(self.get_minorticklocs())