Closed
Description
Description
pick_event
s aren't fired for things that are drawn on parasite axes which were created using the twin*
methods on mpl_toolkits.axes_grid1.host_subplot
host axes.
How to reproduce
Code
from matplotlib import pyplot as plt
from mpl_toolkits.axes_grid1 import host_subplot
from numpy import arange, sin, pi
host_a = host_subplot(111)
para_a = host_a.twin()
# This works:
# a = host_a
# This doesn't:
a = para_a
t = arange(0.0, 3.0, 0.01)
s = sin(2*pi*t)
line, = a.plot(t, s, picker=5)
def onpick(event):
print("picked")
plt.gcf().canvas.mpl_connect('pick_event', onpick)
plt.show()
Steps
- Click on the curve that is drawn.
- Check if "
picked
" was written to standard output.
It works fine if the curve is drawn to the host axes, but it doesn't work if it's drawn on the parasite axes instead.
Info
See also #5580 .
Matplotlib version: 6245d4e
Python version: Any