Description
Bug report
Bug summary
In panning mode of the figure window, all vertical and the common horizontal axes are affected by the very first drag of the mouse, irrespective of the subplot addressed by the mouse. After that, which of the vertical axes are affected depends on the addressed subplot (almost as expected).
Code for reproduction
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
fig, ax1 = plt.subplots()
ax2 = ax1.twinx()
ax_top = make_axes_locatable(ax1).append_axes('top', size=1.2, pad=0., sharex=ax1)
ax_top.xaxis.set_tick_params(labelbottom=False)
ax1.plot([0, 1, 2], [0, 1, 0])
ax2.plot([0, 1, 2], [10, 10, 11])
ax_top.plot([0, 1, 2], [90, 91, 90])
#ax_top.set_navigate(False)
plt.show()
Actual outcome
(A bug that may be related: The right axis extends (with tick marks and tick labels) over the full height including the top subplot, although the right axis is autoscaled so that the trace assigned to it fits into the lower subplot as I expected.)
- On the very first mouse gesture ... (see Bug sumary).
- On subsequent mouse gestures in the top subplot, still all axes are affected.
- On subsequent mouse gestures in the lower subplot, only the two vertical axes of that subplot, left and right, are affected (besides the common x axis).
Expected outcome
- The first drag should not behave differently.
- A drag in the top subplot should only affect the axes of that subplot.
- Expected as observed.
If it is not needed to interactively change the top left axis, a workaround would be ax_top.set_navigate(False)
. This works also for the very first drag.
Matplotlib version
- Operating system: Windows 7
- Matplotlib version: 3.0.0
- Matplotlib backend: TkAgg
- Python version: 3.6.1
Installed using pip