Description
Bug report
jshtml animation uses HTMLWriter
to render animation frames. Digging into the code for this, we see that HTMLWriter lists supported_formats
:
matplotlib/lib/matplotlib/animation.py
Line 785 in c54a5a9
However, there is no way to make use of this. The to_jshtml
method of animation does not provide an interface to specify the frame format, so it must be pulled from rcParams
. rcParams
, in turn, does not allow svg
as an option.
Code for reproduction
import matplotlib
matplotlib.rcParams['animation.frame_format'] = 'svg'
Actual outcome
# ... traceback cruft
ValueError: Key animation.frame_format: Unrecognized animation.frame_format string 'svg': valid strings are ['png', 'jpeg', 'tiff', 'raw', 'rgba']
Expected outcome
rcParams should allow setting frame formats that are supported by any animation writer, not just the ones supported by all.
Aside: rcParams
allows raw
but HTMLWriter doesn't. So there's already precedent.
Matplotlib version
- Operating system: linux
- Matplotlib version: 3.2.1
- Matplotlib backend (
print(matplotlib.get_backend())
): Qt5Agg (but irrelevant to this issue) - Python version: 3.7.6
- Jupyter version (if applicable): n/a
- Other libraries: n/a
conda (main anaconda)