WxMPL: how to catch a mouse click event of a PlotPanel in an embedded wxpython application?

I have the following problem. I'm building a wxpython application with a wxmpl PlotPanel. My ultimate need is to catch the X and Y graph coordinates of points I'm clicking on the graph. While using pylab this is almost trivial, it seems not if I'm using an embedded PlotPanel...

I've tried to mpl_connect the figure object to the button_click_event, this way:



def click_me(mpl_event):
   print 'you click me!'
   if mpl_event.inaxes:
         print 'in axes too!'
   print 'id:',disconnect_id

I receive an id from the mpl_connect method, but the click_me function is never called.

In the WxMPL documentation I also found this:

button_press_event(self, x, y, button, guiEvent=None)

Backend derived classes should call this function on any mouse button press. x,y are the canvas coords: 0,0 is lower, left. button and key are as defined in MouseEvent

but I'm really unsure of its meaning/use. It is something to trap the wx.EVT_LEFT_DOWN?

I'm lost. Any help will be appreciated.

Massimo contacted me off-list to let me know my last email on the topic was overlooked. For posterity, here's the short and sweet recipe.

class SomeClass(wx.SomeWidget):
     def __init__ ...
          # create the plot panel
         self.control = wxmpl.PlotPanel(self, -1)
         # register to receive WxMpl PointEvents
         wxmpl.EVT_POINT(self, self.control.GetId(), self.OnPlotPoint)

     def OnPlotPoint(self, evt):
         print 'POINT'
         # the PointEvent object `evt' contains some useful information...

         # the axes that was clicked on
         print ' axes =', evt.axes

         # matplotlib's X&Y coordinates (not quite the same as wxPython's)
         print ' mpl x =', evt.x
         print ' mpl y =', evt.y

         # axes' X&Y coordinates (the data value that was clicked on)
         print ' data x =', evt.xdata
         print ' data y =', evt.ydata