Message: 8
Date: Wed, 08 Oct 2008 17:05:46 -0400
From: Alan G Isaac <aisaac@...310...>
Subject: Re: [Matplotlib-users] Animation and imshow
To: Matplotlib Users <matplotlib-users@lists.sourceforge.net>
Message-ID: <48ED20AA.90602@...310...>
Content-Type: text/plain; charset=UTF-8; format=flowed> loop through the data and call clf():
if the confusion is over my signature, i still sign using a gpg key
registered to a different email account
The clf call seems quite wrong:
it flashes horribly and I get good
behavior without it (once I add
a call to sleep). What am I
missing?
afaik it doesn't look like there's anything missing
if anything there is some superfluous code:
fig1 = plt.figure(1)
ax1 = fig1.gca()
and the animated=True kwarg
I don't what is optimum, matplotlib has always been a bit hackish for
animation i think
best
Michael Nandris
···
On Thu, 2008-10-09 at 03:15 +0000, matplotlib-users-request@lists.sourceforge.net wrote:
On 10/7/2008 6:23 PM Michael apparently wrote:
Alan Isaac
PS The following almost works (i.e., works,
but then exits with an error).import matplotlib.pyplot as plt
from time import sleep
from numpy import zerosplt.ion()
plt.hold(False)data = list()
slices = list()
for i in range(5):
frame = zeros( (200,200) )
frame[20:40,10*i:10*i+20] = 255
data.append(frame)fig1 = plt.figure(1)
ax1 = fig1.gca()
for frame in data:
plt.imshow(frame, axes=ax1, animated=True)
sleep(0.2)
--
"When you think of the long and gloomy history of man, you will find far
more hideous crimes have been committed in the name of obedience than
have been committed in the name of rebellion". C.P.Snow,
"Either-Or" (1961)