Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 566bd8b

Browse filesBrowse files
t-makarojklymak
authored andcommitted
endless looping GIFs with PillowWriter (#11789)
* add loop kwarg to PillowWriter Adds an optional parameter to PillowWriter that will set the number of times that a gif should loop for. Defaults to 0 meaning endless * next_whats_new file for endless gifs * adjust PillowWriter loop kwarg * add docstring to PillowWriter * ValueError if loop is not an int in PillowWriter * remove API changes * fix typo * kill docstring for now
1 parent 4e9b699 commit 566bd8b
Copy full SHA for 566bd8b

File tree

Expand file treeCollapse file tree

2 files changed

+8
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-1
lines changed
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:orphan:
2+
3+
Endless Looping GIFs with PillowWriter
4+
--------------------------------------
5+
6+
We acknowledge that most people want to watch a gif more than once. Saving an animation
7+
as a gif with PillowWriter now produces an endless looping gif.

‎lib/matplotlib/animation.py

Copy file name to clipboardExpand all lines: lib/matplotlib/animation.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def grab_frame(self, **savefig_kwargs):
562562
def finish(self):
563563
self._frames[0].save(
564564
self._outfile, save_all=True, append_images=self._frames[1:],
565-
duration=int(1000 / self.fps))
565+
duration=int(1000 / self.fps), loop=0)
566566

567567

568568
# Base class of ffmpeg information. Has the config keys and the common set

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.