Displaying saved animations
See original GitHub issueCan a saved animation be displayed in a generated file? I’m using
class Animator(matplotlib.animation.TimedAnimation):
def __init__(self):
animation.TimedAnimation.__init__(self, ...)
Animator().save(fps=..., savefig_kwargs=...)
where animation behavior is controlled in save
, which I presume can’t be scraped. In my context it also fails to animate entirely but I’ve not yet reproduced minimally (a minimal example works fine).
I imagine something like
ani.save("path.mp4")
some_sphinx_gallery_function("path.mp4")
and I’m aware there’s ways to insert images via standard sphinx functionality, but don’t know how to do it inline for HTML generated from .py
by sphinx-gallery.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Saving Animations
It is possible to save the animation window to a local HTML file. You can then bookmark the saved file, and play back...
Read more >Where are the animations I saved? - Google Photos Community
Google created a cool animation from my photos from yesterday. ... Search / Magnifying Glass in the App towards the bottom of the...
Read more >SolidWorks Motion: Part 5 - Saving Animations - YouTube
This part will explain how you can save the animations you have created. The video will go over some of the different settings...
Read more >How to save Matplotlib Animation? - GeeksforGeeks
In this article, we will learn How to save Matplotlib Animation. The animated graphs made with the help of matplotlib can be saved...
Read more >Saving animations and screenshots - the DKRZ documentation!
Saving the animation Save your animation by clicking on File -> Save Animation… This opens a dialogue window, in which you select either...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, and they will run in that order (mpl then yours).
Yes indeed, see:
https://sphinx-gallery.github.io/stable/advanced.html#write-a-custom-image-scraper
in particular the quote:
SG internally just supports mpl (including animations if used properly) and mayavi, with PyVista and PyGMT maintaining their implementations. Other formats – including any saved to disk – are left to the user to support.
What I learned:
'image_scrapers': ('matplotlib', CustomScraper())
appends my scraper to the existing one.sphinx-gallery
doesn’t support.mp4
saved animations, so one must either 1) save as.gif
instead, or 2).mp4
->.gif
in the scraper. Useful:_anim_rst
in scrapers.Can you confirm? I’ve extended the
PNGScraper
to encompass all supported formats: