Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,8 @@ def to_html5_video(self, embed_limit=None):
else:
return 'Video too large to embed.'

def to_jshtml(self, fps=None, embed_frames=True, default_mode=None):
def to_jshtml(self, fps=None, embed_frames=True, default_mode=None,
frame_format=None):
"""
Generate HTML representation of the animation.

Expand All @@ -1366,6 +1367,8 @@ def to_jshtml(self, fps=None, embed_frames=True, default_mode=None):
What to do when the animation ends. Must be one of ``{'loop',
'once', 'reflect'}``. Defaults to ``'loop'`` if the *repeat*
parameter is True, otherwise ``'once'``.
frame_format : str, optional
Image format embedded into the HTML file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Image format embedded into the HTML file
frame_format : str, optional
Image format of the individual frames embedded into the HTML file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also might want to clarify how the default (png) gets set.


Returns
-------
Expand All @@ -1391,6 +1394,8 @@ def to_jshtml(self, fps=None, embed_frames=True, default_mode=None):
writer = HTMLWriter(fps=fps,
embed_frames=embed_frames,
default_mode=default_mode)
if frame_format is not None:
writer.frame_format = frame_format
self.save(str(path), writer=writer)
self._html_representation = path.read_text()

Expand Down
Loading