Re: [Matplotlib-users] moving marker line under mouse

2011-12-13 Thread Sven Duscha
Hi, For anyone still interested in this topic: I implemented a provisional solution myself, but it turned out that there is indeed already an example for a marker/cursor in the matplotlib documentation. It can be found at http://matplotlib.sourceforge.net/examples/pylab_examples/curso

Re: [Matplotlib-users] moving marker line under mouse

2011-12-06 Thread Sven Duscha
>>> Benjamin Root 12/07/11 4:16 AM >>> > > Use draw_idle() if performance is an issue. Also, you don't have to redraw > everything. You can save the object returned by avline() > and in subsequent draws, just modify the data. Usually, there is a set_data() > or a set_xy() method you can use f

Re: [Matplotlib-users] moving marker line under mouse

2011-12-06 Thread Benjamin Root
On Tuesday, December 6, 2011, Sven Duscha wrote: > Hi, > > > I kind of got the basic functionality working using > > > cid = self.fig.canvas.mpl_connect('motion_notify_event', > self.update_marker) > > > def update_marker(self, event): > print "plotMarker()" # DEBUG > self.m

[Matplotlib-users] moving marker line under mouse

2011-12-06 Thread Sven Duscha
Hi, I kind of got the basic functionality working using cid = self.fig.canvas.mpl_connect('motion_notify_event', self.update_marker) def update_marker(self, event): print "plotMarker()" # DEBUG self.marker=self.ax1 #print 'button=%d, x=%d, y=%d, xdata=%

[Matplotlib-users] moving marker line under mouse

2011-12-06 Thread Sven Duscha
Hi, how could I realize a moving marker line under the mouse pointer? I know about event handling http://matplotlib.sourceforge.net/users/event_handling.html and would use ‘ axes_enter_event’ to react on, then draw a line with axvline(x=event.xdata, linewidth=1, color='r') but how can