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
When plotting multiple subplots, the cursor it is correctly shown only in the one given. However, it moves regardless of which subplot the mouse is on. In my opinion, this should not be the case.
I was not able to find a solution to this problem myself.
Code for reproduction
importmatplotlib.pyplotaspltfrommatplotlib.widgetsimportMultiCursorfig=plt.figure(figsize=(18, 12), constrained_layout=True)
gs=fig.add_gridspec(8, 10)
# Let us show 4 subplots:ax0=fig.add_subplot(gs[:4, :5])
ax1=fig.add_subplot(gs[4:, :5])
ax2=fig.add_subplot(gs[:4, 5:])
ax3=fig.add_subplot(gs[4:, 5:])
# Shows a cursor for 2 subplots but it moves regardless of which subplot the mouse is on.multi=MultiCursor(fig.canvas, (ax0, ax1), color='r', lw=1, horizOn=False, vertOn=True)
plt.show()
Actual outcome
Cursor moves regardless of the subplot
Expected outcome
It should move only when the mouse is on the given subplots
Activity
ianhi commentedon May 14, 2021
Hi @fedbont94 good catch - happily this has been fixed already! See #19635 and #19636. Although I'm not sure which version it will be released in?
So I'll close but feel free to re-open if you think this should be kept open.
ianhi commentedon May 14, 2021
Update: It will be released in in
3.4.3see #20232fedbont94 commentedon May 14, 2021
Thanks for the help guys!