On Wed, Feb 17, 2010 at 7:42 AM, Wolfgang Kerzendorf <wkerzend...@googlemail.com> wrote: > Hello, > > I would like to build a bit of an interactive fitter with matplotlib and > ipython (in pylab environment). I would like to have a a function, which > takes x and y as input, then plots these and fits a line to it (just numpy > polyfit). if I click a point it will be removed from the fit pool and the > line will be refitted (optionally after pressing 'f'). when I'm done I can > press 'q' or close the window and the function will come to an end and spit > out the fitting parameter. > I tried this a year or two ago and I had terrible problems with getting > stopping the event loop and waiting for the interactive part to finish and > then finish the function. I'm running os 10.6 and use the wx backend (or mac > os x, if that's easier). Can you point me to an example or give me a crude > overview of how to do that in the right way. Is that understandable?
Take a look at http://matplotlib.sourceforge.net/examples/event_handling/poly_editor.html You can use the 'i' and 'd' keys to insert and delete vertexes, can click and drag them to move them. See also the event handling tutorial at http://matplotlib.sourceforge.net/users/event_handling.html JDH ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users