From 12fcb82b51ab9e19e88f90e54447594256885943 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 27 Jul 2020 22:11:03 +0200 Subject: [PATCH] Add a note on working around limit expansion of set_ticks() --- lib/matplotlib/axis.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 18c2665a8bff..ef1b9b60b5d9 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -1810,6 +1810,13 @@ def set_ticks(self, ticks, minor=False): List of tick locations. minor : bool, default: False If ``False``, set the major ticks; if ``True``, the minor ticks. + + Notes + ----- + The mandatory expansion of the view limits is an intentional design + choice to prevent the surprise of a non-visible tick. If you need + other limits, you should set the limits explicitly after setting the + ticks. """ # XXX if the user changes units, the information will be lost here ticks = self.convert_units(ticks)