Skip to content

Commit 54c9995

Browse files
committed
DOC: Added warnings about not sharing tickers and autoscaling
1 parent 33265e5 commit 54c9995

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,15 @@ def __init__(self, fig, rect,
491491
*yticklabels* sequence of strings
492492
*yticks* sequence of floats
493493
================ =========================================
494+
495+
.. warning::
496+
497+
Setting `share_tickers` to `False` and changing the
498+
`Locator`s of a shared axis may not play with autoscaling.
499+
Autoscaling may need to access the `Locator` object of the
500+
base axis. Normally, with `share_tickers=True`, the axes
501+
are guaranteed to share a `Locator` instance.
502+
494503
""" % {'scale': ' | '.join(
495504
[repr(x) for x in mscale.get_scale_names()])}
496505
martist.Artist.__init__(self)
@@ -3926,6 +3935,15 @@ def twinx(self, share_tickers=True):
39263935
.. note::
39273936
For those who are 'picking' artists while using twinx, pick
39283937
events are only called for the artists in the top-most axes.
3938+
3939+
.. warning::
3940+
3941+
Setting `share_tickers` to `False` and modifying the
3942+
`Locator` of either axis may cause problems with
3943+
autoscaling. Autoscaling may require access to the
3944+
`Locator`, so the behavior will be undefined if the base and
3945+
twinned axis do not share a `Locator` instance.
3946+
39293947
"""
39303948
ax2 = self._make_twin_axes(sharex=self, share_tickers=share_tickers)
39313949
ax2.yaxis.tick_right()
@@ -3954,6 +3972,15 @@ def twiny(self, share_tickers=True):
39543972
.. note::
39553973
For those who are 'picking' artists while using twiny, pick
39563974
events are only called for the artists in the top-most axes.
3975+
3976+
.. warning::
3977+
3978+
Setting `share_tickers` to `False` and modifying the
3979+
`Locator` of either axis may cause problems with
3980+
autoscaling. Autoscaling may require access to the
3981+
`Locator`, so the behavior will be undefined if the base and
3982+
twinned axis do not share a `Locator` instance.
3983+
39573984
"""
39583985

39593986
ax2 = self._make_twin_axes(sharey=self, share_tickers=share_tickers)

0 commit comments

Comments
 (0)