If you have overlapping axes using twinx, or twiny, the one with with
higher zorder gets the mouse signal. Using
reference, both have a zorder of 1 and ax2 gets the signal be default.
Unfortunately, one cannot simply set
While this does cause ax1 to get the mouse events and the toolbar
reports the coords from ax1, it is not hidden behind ax2 since "twiny"
does other stuff like making the "upper" axes frame invisible. So to
move ax1 to the top and have the figure draw correctly, you need
In : ax1.set_zorder(0.1)
In : ax1.set_frame_on(False)
In : ax2.set_frame_on(True)
It would be nice to have a property like "receive_mouse" attached to
the axes which could be controlled/toggled from the figure window so
one could easily switch between which overlapping axes receives mouse
On Wed, Jan 13, 2010 at 6:59 AM, boriq <borique@...287...> wrote:
i have a plot with 2 y-axes and 1 x-axis. The mouse pointer shows the
y-coordinates of the second y-axis, but I want the mouse pointer to show the
y-coordinate of the first y-axis.
Is there a way how to switch the mouse pointer to the first y-axis?