lava / matplotlib-cpp

Extremely simple yet powerful header-only C++ plotting library built on the popular matplotlib
MIT License
4.38k stars 1.13k forks source link

How to save the animation to a local file? #283

Open xiang-tao opened 3 years ago

xiang-tao commented 3 years ago

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

yosserdavanzo commented 2 years ago

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!
xiang-tao commented 2 years ago

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.