Python - animation with matplotlib.pyplot

前端 未结 3 922
心在旅途
心在旅途 2020-12-13 14:25

How can one create animated diagrams using popular matplotlib library? I am particularly interested in animated gifs.

3条回答
  •  别那么骄傲
    2020-12-13 15:04

    The matplotlib docs provide an entire section of examples on animation (see this scipy tutorial also). Most, however, involve using the various GUI widget backends. There is one in there, "movie demo", that shows how to produce an avi of a series of PNGS.

    To produce animated GIFs, I think your options are pretty limited. Last I checked, PIL didn't support them. You could however generate a series of PNGs using pyplot's savefig and then stitch them together using a call to ImageMagick or mencoder.

提交回复
热议问题