Make Animation._repr_html_ more useful by default by QuLogic · Pull Request #31510 · matplotlib/matplotlib · GitHub
Skip to content

Make Animation._repr_html_ more useful by default - #31510

Merged
QuLogic merged 1 commit into
matplotlib:mainfrom
QuLogic:default-html-animation
Oct 17, 2026
Merged

QuLogic merged 1 commit into
matplotlib:mainfrom
QuLogic:default-html-animation

Conversation

@QuLogic

@QuLogic QuLogic commented Apr 16, 2026 •

Copy link
Copy Markdown
Member

PR summary

While Animation does define _repr_html_, it does nothing by default since animation.html is 'none'. The 'html5' option is the best, but it requires FFmpeg to be installed. So introduce a new 'auto' option that picks either one depending on what's available, and make it the default.

This still needs some docs/tests, if we are okay with this approach.

AI Disclosure

None

PR checklist

@timhoffm

Copy link
Copy Markdown
Member

@QuLogic
QuLogic force-pushed the default-html-animation branch from 55e23db to 690f7d3 Compare April 18, 2026 08:30
@story645

Copy link
Copy Markdown
Member

I'm +1 on this too, would definitely make tutorials more straightforward.

@QuLogic

QuLogic commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

@QuLogic
QuLogic force-pushed the default-html-animation branch from 4a65929 to 9339751 Compare August 11, 2026 00:52
@github-actions github-actions Bot added the Documentation: user guide files in galleries/users_explain or doc/users label Aug 11, 2026

@timhoffm timhoffm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment thread lib/matplotlib/animation.py Outdated
While `Animation` does define `_repr_html_`, it does nothing by default
since `animation.html` is 'none'. The 'html5' option is the best, but it
requires FFmpeg to be installed. So introduce a new 'auto' option that
picks either one depending on what's available, and make it the default.
@QuLogic
QuLogic force-pushed the default-html-animation branch from d20225f to 95fab38 Compare October 16, 2026 19:44
@QuLogic
QuLogic merged commit 5910a8b into matplotlib:main Oct 17, 2026
41 checks passed
@QuLogic
QuLogic deleted the default-html-animation branch October 17, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation: user guide files in galleries/users_explain or doc/users topic: animation topic: rcparams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants