Re: [Matplotlib-users] Animation and imshow

2008-10-09 Thread Alexander Borghgraef
On Wed, Oct 8, 2008 at 12:23 AM, Michael [EMAIL PROTECTED] wrote:
 loop through the data and call clf():

 from pylab import *
 from numpy import *

 ion()
 hold(False)

 frame1 = zeros((200, 200))
 frame1[20:40, 20:40] = 255

 frame2 = zeros((200, 200))
 frame2[20:40, 30:50] = 255

 frame3 = zeros((200, 200))
 frame3[20:40, 40:60] = 255

 frame4 = zeros((200, 200))
 frame4[20:40, 50:70] = 255

 frame5 = zeros((200, 200))
 frame5[20:40, 50:70] = 255

 data=[frame1,frame2,frame3,frame4,frame5]

 for frame in data:
m=imshow(frame)
m.set_data(frame)
clf()
 show()
 #close()

If you do this, you can skip the set_data call, it works quite well
without it. Blinks horribly though.

-- 
Alex Borghgraef

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Animation and imshow

2008-10-07 Thread Alexander Borghgraef
I'm trying to figure out how to do animated graphics in pylab using
imshow, so I made this little 'hello world' equivalent showing a
moving square over two frames.
Problem is I have to call draw twice to refresh the image. Anyone can
explain why this is so (and how to do this more elegantly)? This is
the code:

from pylab import *
from numpy import *

ion()
hold(False)

frame1 = zeros((200, 200))
frame1[20:40, 20:40] = 255

frame2 = zeros((200, 200))
frame2[20:40, 30:50] = 255

m = imshow(frame1)
draw()   # shows frame1
m.set_data(frame2)
draw()   # still shows frame1!!!
draw()   # and now it shows frame2!??


-- 
Alex Borghgraef

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 3D scatterplot histogram + error ellipses

2007-08-06 Thread Alexander Borghgraef
Hi all,

 I'm trying to display the histograms of lists of 2D vectors together with
their error ellipses in a 3D plot.
Plotting the histograms as 3D scatterplots is easy using
matplotlib.axes3d.Axes3D( ).scatter3D( x, y, h ),
but how do I draw the error ellipse in the ( x, y ) plane. I know how to
create a matplotlib.patches.Ellipse
object, but I'm pretty clueless on how to integrate it into the figure. Any
help?

-- 
Alex Borghgraef
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users