[Matplotlib-users] pick events don't work with twiny

Neal Becker ndbecker2 at gmail.com
Tue Jan 30 10:10:32 EST 2018


I find that pick events are fine until I add twiny.  In that case, nothing 
happens when clicking.

THe code outline is like:

fig, ax = plt.subplots()
ax2 = ax.twiny()
ax.semilogy(...)
fig.canvas.mpl_connect('pick_event', onpick)
ax2_xaxis = np.linspace (*ax.get_xlim(), endpoint=True,)/conversion
ax2.semilogy (ax2_xaxis, np.ones (len(ax2_xaxis)) * 1e-3, alpha=0)
ax2.set_xlabel(...)
...

removing all the lines about ax2 will restore pick function.



More information about the Matplotlib-users mailing list