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 we using a MultiCursor on an axes and an inset axis, the cursor follow the mouse only on the main axes. When the mouse cursor move on the inset axes the cursor don't move.
Code for reproduction
importnumpyasnpimportmatplotlib.pyplotaspltfrommatplotlib.widgetsimportMultiCursor# Fixing random state for reproducibilitynp.random.seed(19680801)
# some random datax=np.random.randn(1000)
y=np.random.randn(1000)
defscatter_hist(x, y, ax, ax_histx, ax_histy):
# no labelsax_histx.tick_params(axis="x", labelbottom=False)
ax_histy.tick_params(axis="y", labelleft=False)
# the scatter plot:ax.scatter(x, y)
# now determine nice limits by hand:binwidth=0.25xymax=max(np.max(np.abs(x)), np.max(np.abs(y)))
lim= (int(xymax/binwidth) +1) *binwidthbins=np.arange(-lim, lim+binwidth, binwidth)
ax_histx.hist(x, bins=bins, label="X")
ax_histy.hist(y, bins=bins, orientation='horizontal', label="Y")
# Create a Figure, which doesn't have to be square.fig=plt.figure(layout='constrained')
# Create the main axes, leaving 25% of the figure space at the top and on the# right to position marginals.ax=fig.add_gridspec().subplots()
# The main axes' aspect can be fixed.#ax.set(aspect=1)# Create marginal axes, which have 25% of the size of the main axes. Note that# the inset axes are positioned *outside* (on the right and the top) of the# main axes, by specifying axes coordinates greater than 1. Axes coordinates# less than 0 would likewise specify positions on the left and the bottom of# the main axes.ax_histx=ax.inset_axes([0, -0.25, 1, 0.12], sharex=ax)
ax_histy=ax.inset_axes([-0.25, 0, 0.12, 1], sharey=ax)
ax_plus=ax.inset_axes([1.05, 0, 0.02, 1])
# Draw the scatter plot and marginals.scatter_hist(x, y, ax, ax_histx, ax_histy)
multi1=MultiCursor(None, (ax, ax_histx), useblit=False, horizOn=False, vertOn=True, color='r', lw=1)
multi2=MultiCursor(None, (ax_histy, ax), useblit=False, horizOn=True, vertOn=False, color='r', lw=1)
#ax.set_aspect(0.5)plt.show()
Actual outcome
simplescreenrecorder-2023-06-30_16.45.57.mp4
Expected outcome
The cursor move following mouse for all axis.
Additional information
No response
Operating system
Ubuntu
Matplotlib Version
3.1.6
Matplotlib Backend
QtAgg
Python version
3.10.6
Jupyter version
No response
Installation
pip
The text was updated successfully, but these errors were encountered:
Bug summary
When we using a MultiCursor on an axes and an inset axis, the cursor follow the mouse only on the main axes. When the mouse cursor move on the inset axes the cursor don't move.
Code for reproduction
Actual outcome
simplescreenrecorder-2023-06-30_16.45.57.mp4
Expected outcome
The cursor move following mouse for all axis.
Additional information
No response
Operating system
Ubuntu
Matplotlib Version
3.1.6
Matplotlib Backend
QtAgg
Python version
3.10.6
Jupyter version
No response
Installation
pip
The text was updated successfully, but these errors were encountered: