On Dec 10, 2007 11:53 AM, Venkat Ramanan <[EMAIL PROTECTED]> wrote: > If anyone faces a similar issue, there is a solution here. > > http://scipy.org/Cookbook/Matplotlib/Interactive_Plotting > > Essentially, we should also check for "toolbar.mode"
You may also want to look at the widget lock variable, which the toolbar manages and user code can acquire or view the lock, eg examples/lasso_demo.py. This is somewhat more robust than using the toolbar mode string because it will allow other code, not part of the toolbar, to share and use the lock. def callback(self, verts): ind = nonzero(points_inside_poly(self.xys, verts))[0] for i in range(self.Nxy): if i in ind: self.facecolors[i] = Datum.colorin else: self.facecolors[i] = Datum.colorout self.canvas.draw_idle() self.canvas.widgetlock.release(self.lasso) del self.lasso def onpress(self, event): if self.canvas.widgetlock.locked(): return if event.inaxes is None: return self.lasso = Lasso(event.inaxes, (event.xdata, event.ydata), self.callback) # acquire a lock on the widget drawing self.canvas.widgetlock(self.lasso) ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users