Question

So in the examples of matplotlib.animation there are two main functions that are used to make animations: AritstAnimation and FuncAnimation.

According to the documentation the use of each of them is:

.ArtistAnimation:

Before calling this function, all plotting should have taken place and the relevant artists saved.

FuncAnimation Makes an animation by repeatedly calling a function func, passing in (optional) arguments in fargs.

So it appears to me that ArtistAnimation is useful when you have already the whole array, list or set of whatever object you want to make an animation from. FuncAnimation in the other hand seems to be more useful whenever you have a function that is able to give it your next result.

Is my intuition above correct about this? My question in general is when is more convenient to use one or the other.

Thanks in advance

No correct solution

OTHER TIPS

I think you are right, although it is simple to go from a list to a function (just iterate over it) or back (store function values in an array).

So it really doesn't matter too much, but you can pick the one that best suits your code, as you described.

(Personally I find ArtistAnimation to be the most convenient)

If your result is very large, it might be good to use FuncAnimation so you don't need to store your data. MPL still stores it's own copy for plotting, but this factor two might make a difference.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top