On 2/5/07, JJ <[EMAIL PROTECTED]> wrote: > I am just learning and do have a couple of questions. > Why is the lock on lasso needed in the original demo. > For my revised version, it works better without it (a > right click without dragging caused an infinite lock).
The locking is designed to prevent conflict with other resources that may be competing with you to draw to the screen. Ie, if you enable zoom to rect mode and the matplotlib backend is drawing a zoom rectangle and you are drawing a lasso. In this case you'll get an exception which should remind you that the resources are already taken. There may be a better way to enable resource sharing, though.. I'm not sure about the lock you experienced right now..... > > Also, I would have expected the callback function to > be executed directly on execution of the self.lasso = > Lasso(...) line in the onpress function, but instead > it is executed after the last line of the onpress > function. Why is this? > Well, the callback is triggered after the mouse us released, ie after the lasso is complete. The onpress sets up the lasso widget, which in turn connects to the mouse move and mouse release events. When you are done with the lasso and release the mouse, it triggers your callback. You could change this behavior by subclassing Lasso -- it's a pretty small class that lives in matplotlib.widgets. One could do everything on mouse motion, which could be computationally expensive but might be what you are looking for. I'm not quite sure what you are expecting to happen. JDH ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users