matplotlib-cpp icon indicating copy to clipboard operation
matplotlib-cpp copied to clipboard

How to save the animation to a local file?

Open xiang-tao opened this issue 3 years ago • 2 comments

How to save the drawn animation to a local file? For example, I want to save it as example.gif.

xiang-tao avatar Sep 20 '21 03:09 xiang-tao

Workaround:

  1. install imagemagick
  2. save each step of the animation as png in a folder (plots/1.png plots/2.png ....)
  3. stitch all the pngs together convert-delay 10 -loop 0 plots/*.png animation.gif
  4. good luck!

yosserdavanzo avatar Oct 20 '21 10:10 yosserdavanzo

Thank you for your answer. I have exported the data and implemented dynamic drawing with python, but I will try to implement the solution you gave.

xiang-tao avatar Oct 20 '21 10:10 xiang-tao