You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: fig.canvas.mpl_connect in 3.5.2 not registering events in jupyter lab unless using widget pan or zoom controls #23470
In jupyter lab, the code snippet below sets the title of the axis to the x,y coords of a mouse click, however in matplotlib 3.5.2 specifically, the clicks aren't registered unless I'm clicking around using the pan or zoom controls of the interactive widget. Downgrading to matplotlib 3.5.1, the clicks are registered with just the cursor as expected with the same ipympl version 0.9.1.
No axis title after clicking inside the plot with just a regular cursor
Axis title set after clicking inside the plot with the pan tool of the interactive widget (same if using the zoom tool)
Expected outcome
This screenshot was taken with mpl version 3.5.1 where the regular cursor click was registered and the axis title was changed
Additional information
It's also interesting that under mpl 3.5.2, the cursor remains as the finger cursor icon after clicking while in mpl 3.5.1, the cursor icon changes back to the regular pointer - I'm not sure what that means but it is a difference in behavior...
Some relevant package versions:
matplotlib 3.5.2
ipympl 0.9.1
jupyterlab 3.4.3
Activity
tacaswell commentedon Jul 22, 2022
I can reproduce this on v3.5.2 but can not reproduce it on the v3.5.x branch
My attempt to bisect this failing due to an issue with traitlets getting the wrong type of toolbar (?!)
QuLogic commentedon Jul 26, 2022
Bisect tells me it was fixed by #23113, and it originally broke in #22005.
tacaswell commentedon Jul 26, 2022
I think this is duplicate of #23042 and already fixed. Sorry for breaking this.
tacaswell commentedon Jul 26, 2022
As a side note, @QuLogic figured out the problem I was having with bisecting:
tacaswell commentedon Jul 26, 2022
And like #23042 adding an explicit
plt.ion()should fix this on 3.5.2.