I'm building a simple wxpython + matplotlib application using wxmpl (no pylab).
I'm currently trying to get X and Y coordinates of a point I click inside a graph plotted in a PlotPanel.
So I'm trying to connect the PlotPanel to a button_press_event. The problem is it fails silently. No error, but it seems that the connected function is never called and even that the connecting itself never happens.
My hypothesis: I see that the PlotPanel has default zooming when selecting a box with the mouse, so I think it is already connected with button_press_event? should I disconnect? how (what's the id)? Should I use something different from PlotPanel?
Here are relevant code snippets:
[Then, if I send the right wxpython event (I want my plot giving me coordinates only when I say the gui to do it), I call ClickPlot, that should turn on the connection between the mpl event 'button_press_event' and another function, for my PlotPanel.]
print 'you're calling ClickPlot()'
print 'you click me!'
print 'in axes too!'
I checked and ClickPlot() is called, but as said before, click_me() is not. Any idea? What could I do to figure out what's (not) happening?
University of Bologna
Department of Biochemistry "G.Moruzzi"
Via Irnerio 48, 40126 Bologna, Italy