Hello, 

on my macOSX (didn't check other OS), scroll_event misses every other two event 
when I use mouse wheel 
(wx.EVT_MOUSEWHEEL works fine) 
exemple code: 


import wx 
import numpy 
import matplotlib 
import sys 
from matplotlib.figure import Figure 
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas 

class TestFrame(wx.Frame): 
def __init__(self,parent,title): 
wx.Frame.__init__(self,parent,title=title,size=(500,500)) 
self.sp = wx.SplitterWindow(self) 
self.p1 = WxPanel(self.sp) 
self.p2 = MplPanel(self.sp) 
self.sp.SplitVertically(self.p1,self.p2) 

class WxPanel(wx.Panel): 
def __init__(self, parent): 
wx.Panel.__init__(self, parent,-1,size=(50,50)) 
self.Bind(wx.EVT_MOUSEWHEEL,self.OnMouseWheel) 

def OnMouseWheel(self,event): 
print "wx scroll event" 
sys.stdout.flush() 

class MplPanel(wx.Panel): 
def __init__(self, parent): 
wx.Panel.__init__(self, parent,-1,size=(50,50)) 
self.figure = Figure() 
self.axes = self.figure.add_subplot(111) 
self.axes.plot(numpy.arange(0.0,10,1.0),[0,1,0,1,0,2,1,2,1,0]) 
self.canvas = FigureCanvas(self,-1,self.figure) 
self.canvas.mpl_connect('scroll_event', self.OnMouseWheel) 

def OnMouseWheel(self,event): 
print "mpl scroll event" 
sys.stdout.flush() 

app = wx.App(redirect=False) 
frame = TestFrame(None, 'Hello World!') 
frame.Show() 
app.MainLoop() 


any idea? 
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to