On Tuesday, December 6, 2011, Sven Duscha <dus...@astron.nl> 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.marker=self.ax1
>
> #print 'button=%d, x=%d, y=%d, xdata=%f, ydata=%f'%(
> # event.button, event.x, event.y, event.xdata, event.ydata)
> # DEBUG
>
> self.ax1.axvline(x=event.xdata, linewidth=1, color='r')
> self.canvas.draw() # redraw
>
>
>
>
>
> but I still have the problem that previous lines still appear on the
> plot.
>
>
> Also, canvas.draw() seems to be a bit of a performance hog. Does anyone
> have
> any more sophisticated solution to this?
>
>
> Cheers,
>
>
> Sven
>
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 for this.
Ben Root
------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of
discussion for anyone considering optimizing the pricing and packaging model
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users