From: Tim L. <ti...@cs...> - 2005-05-30 15:59:17
|
On Mon, 30 May 2005, Nils Wagner <nw...@me...> wrote... > Hi all, >=20 > I am going to switch over to matplotlib. > How can I convert the example with respect to matplotlib ? >=20 >=20 > from scipy import * > from scipy.xplt import * > import gui_thread > xplt.hold('on') > for t in arange(0,10,0.1): > xplt.plot(t,sin(t),'g+') > xplt.pause(10) > xplt.plot(t,cos(t),'ro') > xplt.xlabel('Time t[s]') > xplt.ylabel('Response') import time =66rom pylab import * ion() for t in arange(0, 2, 0.1): scatter([t], [sin(t)], color=3D'g', marker=3D's') time.sleep(0.05) scatter([t], [cos(t)], color=3D'r', marker=3D'o') draw() xlabel('Time t[s]') ylabel('Response') ioff() show() This is how I would best approximate what your xplt code does. I'm sure someone will point out how this could be done better, but psuedo animation isn't my thing :) If you have a look around in the examples directory of the source distribution you should be able to find plenty of snippets which give you a feel for how to write matplotlib code. anim.py is kind of similar to what you've done here. Feel free to ask here if you have any other questions. Cheers, Tim >=20 > Nils >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit http://developer.yahoo.net/?fr=3Doffad-ysdn-ostg-q22= 005 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >=20 `- |