Creating frames for use with ArtistAnimation?

Hi,

I am creating a big and complicated plot by doing things like:

ax.add_patch( ... )

and when I'm done I want to save the resulting frame. However, I've looked through
the examples and it seems like you have to use plot() or pcolor() to create frames that you
can feed into ArtistAnimation.

So,then, how can I use capture the resulting axes into a frame?

Thanks!

reckoner,

Sorry for the delay in responding. No, you don’t need to use plot() or pcolor() to use ArtistAnimation. Functions like plot() take input data, create Artists and/or Collection objects, attach them to an axes and returns those objects that have been created. So, when you do a “ax.add_patch()”, it is actually exactly what some of the plotting functions do internally.

All you need to do to make things work is to have a list of Artists/Collections (such as your patches) for each frame and build up a list of these lists. That list can then be passed to the constructor for ArtistAnimation.

I hope that helps!
Ben Root

···

On Sat, Feb 11, 2012 at 8:22 AM, reckoner <reckoner@…2015…87…> wrote:

Hi,

I am creating a big and complicated plot by doing things like:

ax.add_patch( … )

and when I’m done I want to save the resulting frame. However, I’ve

looked through

the examples and it seems like you have to use plot() or pcolor() to

create frames that you

can feed into ArtistAnimation.

So,then, how can I use capture the resulting axes into a frame?

Thanks!