Description
I have asked this on the matplotlib-users
mailing list (https://mail.python.org/pipermail/matplotlib-users/2018-July/001464.html) and I was encouraged to open an issue here.
Bug report
Bug summary
Animations created with to_jshtml()
are centered, and it is quite hard to un-center them.
The culprit is this line:
matplotlib/lib/matplotlib/_animation_data.py
Line 151 in c552bdc
Code for reproduction
An example can be seen on this page: https://splines.readthedocs.io/en/latest/bezier.html
Actual outcome
The HTML+JS animations are centered.
Expected outcome
Ideally, the alignment of animations should be the same as when using to_html5_video()
and the same as for normal plots.
In other words, the animations should be left-aligned.
If the previous behavior isn't supposed to be changed, it would be great to add an option that allows disabling the centered alignment.
Another reason to remove the alignment: the "align" attribute of "div" elements is "obsolete" and "deprecated" according to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div
Matplotlib version
- Matplotlib version: all versions since JSAnimation was included (Import JSAnimation into the animation module. (Fixes #4703) #4821), JSAnimation had the same problem before