This is relating wxmpl (wxPython+matplotlib). version 2.0dev of wxmpl,
matplotlib ver 1.1.0, and wx version is 2.8.12.1.
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().
I believe the issue is the overlapping of both axes on the same area.
The following code shows that just slightly 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.
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 = 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()