On Wed, Jan 13, 2010 at 6:59 AM, boriq <bori...@gmail.com> wrote: > > Hi all, > > 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?
If you have overlapping axes using twinx, or twiny, the one with with higher zorder gets the mouse signal. Using http://matplotlib.sourceforge.net/examples/api/two_scales.html for reference, both have a zorder of 1 and ax2 gets the signal be default. Unfortunately, one cannot simply set ax1.set_zorder(1) 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 [115]: ax1.set_zorder(0.1) In [116]: ax1.set_frame_on(False) In [117]: 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 events. JDH ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users