Skip to content

Commit f8be0bb

Browse files
authored
Merge pull request #21183 from meeseeksmachine/auto-backport-of-pr-21081-on-v3.5.x
Backport PR #21081 on branch v3.5.x (Improve docs for to_jshtml())
2 parents ed1b1ec + 55cb6ad commit f8be0bb

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

doc/api/animation_api.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ to. If you do not hold a reference to the `Animation` object, it (and
3232
hence the timers) will be garbage collected which will stop the
3333
animation.
3434

35-
To save an animation to disk use `Animation.save` or `Animation.to_html5_video`
35+
To save an animation use `Animation.save`, `Animation.to_html5_video`,
36+
or `Animation.to_jshtml`.
3637

3738
See :ref:`ani_writer_classes` below for details about what movie formats are
3839
supported.

lib/matplotlib/animation.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,20 @@ def to_html5_video(self, embed_limit=None):
12991299
return 'Video too large to embed.'
13001300

13011301
def to_jshtml(self, fps=None, embed_frames=True, default_mode=None):
1302-
"""Generate HTML representation of the animation"""
1302+
"""
1303+
Generate HTML representation of the animation.
1304+
1305+
Parameters
1306+
----------
1307+
fps : int, optional
1308+
Movie frame rate (per second). If not set, the frame rate from
1309+
the animation's frame interval.
1310+
embed_frames : bool, optional
1311+
default_mode : str, optional
1312+
What to do when the animation ends. Must be one of ``{'loop',
1313+
'once', 'reflect'}``. Defaults to ``'loop'`` if ``self.repeat``
1314+
is True, otherwise ``'once'``.
1315+
"""
13031316
if fps is None and hasattr(self, '_interval'):
13041317
# Convert interval in ms to frames per second
13051318
fps = 1000 / self._interval

0 commit comments

Comments
 (0)