Make Animation._repr_html_ more useful by default · matplotlib/matplotlib@cfeabab · GitHub
Skip to content

Commit cfeabab

Browse files
committed
Make Animation._repr_html_ more useful by default
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.
1 parent 3058ff0 commit cfeabab

3 files changed

Lines changed: 20 additions & 10 deletions

File tree

‎lib/matplotlib/animation.py‎

Lines changed: 7 additions & 0 deletions

‎lib/matplotlib/mpl-data/matplotlibrc‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,11 @@
825825
## ***************************************************************************
826826
## * ANIMATION *
827827
## ***************************************************************************
828-
#animation.html: none # How to display the animation as HTML in
829-
# the IPython notebook:
830-
# - 'html5' uses HTML5 video tag
831-
# - 'jshtml' creates a JavaScript animation
828+
#animation.html: html5 # How to display the animation as HTML in the IPython notebook:
829+
# - 'none' displays nothing
830+
# - 'html5' uses HTML5 video tag
831+
# - 'jshtml' creates a JavaScript animation
832+
# - 'auto' picks the best available option
832833
#animation.writer: ffmpeg # MovieWriter 'backend' to use
833834
#animation.codec: h264 # Codec to use for writing movie
834835
#animation.bitrate: -1 # Controls size/quality trade-off for movie.

‎lib/matplotlib/rcsetup.py‎

Lines changed: 8 additions & 6 deletions

0 commit comments

Comments
 (0)