Skip to content

Commit 320dc30

Browse files
committed
ENH: Don't center the HTML animation rendering (Fixes #11795)
Centering the animations makes them align differently than the regular images in the notebook. Also, align attribute is somewhat deprecated. This changes to use inline-block with a div to put the whole animation at the left, and then center the controls within that block.
1 parent 108501c commit 320dc30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/_animation_data.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@
148148

149149
# HTML template for HTMLWriter
150150
DISPLAY_TEMPLATE = """
151-
<div class="animation" align="center">
151+
<div class="animation" align="center"
152+
style="display: inline-block;margin:auto">
152153
<img id="_anim_img{id}">
153154
<br>
154155
<input id="_anim_slider{id}" type="range" style="width:350px"

0 commit comments

Comments
 (0)