This is relating wxmpl (wxPython+matplotlib). version 2.0dev of wxmpl,
matplotlib ver 1.1.0, and wx version is 2.8.12.1.

Since wxmpl is a very "thin" layer above mpl, I believe this is an issue
with mpl.

I'm using wxmpl and trying to get mouse points and selection. This
fails when there is more than one axes in the same place, which I do
since I'm using twinx() in my original code.

I believe the issue is the overlapping of both axes on the same area.
The following code shows that overlapping two axes makes
the mouse events in the overlapped area fail. For example, the cursor
doesn't change in them and the crosshairs disappear (if enabled).
Removing the ax2 code, or just ensuring ax1 and ax2 do not overlap
allows all the events to reach the handler.

Any idea on how to receive mouse events from the overlapped area?

Thanks,
Oren

----------------------------------------------------

import wxmpl

if __name__ == '__main__':
   class MainWindow(wx.Frame):
       def __init__(self):
           wx.Frame.__init__(self, parent=None, title='Graph Test',
size=(700,700))

           self.plot = wxmpl.PlotPanel(self, -1, dpi=70)

           fig = self.plot.get_figure()
           ax1 = fig.add_axes((0.1, 0.1, .6, .6))
           ax1.plot([0,3], [-1,1])
           ax2 = fig.add_axes( (0.3, 0.3, .6, .6) )
           ax2.plot([2,4], [-10,10])

           wxmpl.EVT_POINT(self.plot, -1, self.handle_event)

           self.Show()

       def handle_event(self, event):
           print event, event.GetId()

   app = wx.App()
   mw = MainWindow()
   app.MainLoop()

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to