moving a patch

Hello,

I am trying to generate a short movie using matplotlib.
The core of my code looks like

    for i in range(1,len(t)):
        U0,U1x,U1y,H1 = list(sig[i,:])

        for x in arange(0,1.001,0.05):
            for y in arange(0,1.001,0.05):
                xx,yy=trace(U0,U1x,U1y,H1,x,y)
                ts[(x,y)].set_data(xx,yy)

        for j in range(0,nobs):
            tr[j].center = (obs[i,2*j],obs[i,2*j+1])

        savefig("f%04d.png"%i)

where the entries of the dictionary 'ts' are lines and the entries of
the dictionary 'tr' a patches (circles). Moving the lines around with
set_data works quite fine, but moving the patches by setting 'center'
does not.

My question: how do I move a patch?

Many thanks,
Jochen

···

--
http://seehuhn.de/

How are you turning your PNGs into an animation?

Thanks,
Alan Isaac

PS I know about
http://www.pymolwiki.org/index.php/Category%3ASoftware_Movies

I use the following on Debian Sarge linux (both x86_64 and i686, although I hope/think it would work on any architecture and hopefully any linux distro):

"ffmpeg -hq -b 8000 -f mpeg2video -r 30 -i frame%03d.png movie.mpeg"

You may now skip the rest of this email, which is an uncalled-for venting-of-frustration.

Unfortunately, it seems bazillions of software companies think they can make bazillions of dollars by releasing yet another codec encumbered by more-or-less (but usually more) restrictive licensing conditions, leaving only lowest-common denominator codecs available for those of us who prefer to work without such restrictions. I sought long and hard to do something better than the above, but I can say this about the above command:

* it produces movies that play in Windows (including PowerPoint, which isn't a given, even if it plays in Windows Media Player -- c'mon Microsoft, this is 2006, we should be able to play movies in our presentations), Mac OS X, and linux (Debian sarge, amd64 and i386, at least)
* it seems to work with a standard Debian setup, and doesn't require using DLLs imported from some Windows system to to the encoding
* it seems very fragile -- changing the frame rate or the codec usually breaks one of the above points
* mpeg2 is probably also burdened by some licensing restrictions which I'm unaware of
* on some Windows boxes/programs, white backgrounds get displayed as gray for some reason

Wishing that in 2006 we as a human race could come up with a better, open video format, but willing to accept even minor improvements to the above script,
Andrew

Alan G Isaac wrote:

···

How are you turning your PNGs into an animation?

Thanks,
Alan Isaac

PS I know about
http://www.pymolwiki.org/index.php/Category%3ASoftware_Movies

OK. Thanks for the information and warning.

Did you experiment with MNG, or is support just not there yet?
(And will the next PIL be supporting MNG?)

Cheers,
Alan Isaac

···

On Fri, 26 May 2006, Andrew Straw apparently wrote:

ffmpeg -hq -b 8000 -f mpeg2video -r 30 -i frame%03d.png movie.mpeg"
* it seems very fragile -- changing the frame rate or the
codec usually breaks one of the above points

Hi Alan,

···

On Fri, May 26, 2006 at 12:26:07PM -0400, Alan G Isaac wrote:

How are you turning your PNGs into an animation?

Sorry about the slow answer. I just used mencoder:

    mencoder 'mf://oc/*.png' -mf type=png:fps=12 -ovc lavc -lavcopts vcodec=mpeg4 -o ocean.avi

All the best,
Jochen
--
http://seehuhn.de/

Hi Andrew,

Wishing that in 2006 we as a human race could come up with a better,
open video format, ...

I think most of the problems is caused by software patents. It is
just not safe for Linux distributions etc. to integrate video
encoders, so all the solutions which exist are hidden away somewhere,
are not well integrated into the system, and also not too well tested.

By the way: does anybody know how to move a patch in matplotlib?
set_data works for lines, but what works for patches?

Many thanks,
Jochen

···

On Fri, May 26, 2006 at 11:42:07AM -0700, Andrew Straw wrote:
--
http://seehuhn.de/