Skip to content

Commit eaa22e1

Browse files
committed
Update saving animation section
1 parent 5e2f4ef commit eaa22e1

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

tutorials/introductory/animation_tutorial.py

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ def update(frame):
185185
# alternatives but are more useful for debugging as they save each frame in
186186
# a file before stitching them together into an animation.
187187
#
188+
# Saving Animations
189+
# -----------------
190+
#
188191
# ================================================ ===========================
189192
# Writer Supported Formats
190193
# ================================================ ===========================
@@ -224,18 +227,26 @@ def update(frame):
224227

225228

226229
ani = animation.FuncAnimation(fig=fig, func=update, frames=240, interval=200)
227-
# ani.save(filename="/tmp/pillow_example.gif", writer="pillow")
228-
# ani.save(filename="/tmp/pillow_example.apng", writer="pillow")
229-
230-
# ani.save(filename="/tmp/html_example.html", writer="html")
231-
# ani.save(filename="/tmp/html_example.htm", writer="html")
232-
# ani.save(filename="/tmp/html_example.png", writer="html")
233-
234-
# Since the frames are piped out to ffmpeg, this supports all formats
235-
# supported by ffmpeg
236-
# ani.save(filename="/tmp/ffmpeg_example.mkv", writer="ffmpeg")
237-
# ani.save(filename="/tmp/ffmpeg_example.mp4", writer="ffmpeg")
238-
# ani.save(filename="/tmp/ffmpeg_example.mjpeg", writer="ffmpeg")
239230

240-
# Imagemagick
241-
# ani.save(filename="/tmp/imagemagick_example.gif", writer="imagemagick")
231+
###############################################################################
232+
# Pillow writers::
233+
#
234+
# ani.save(filename="/tmp/pillow_example.gif", writer="pillow")
235+
# ani.save(filename="/tmp/pillow_example.apng", writer="pillow")
236+
#
237+
# HTML writers::
238+
#
239+
# ani.save(filename="/tmp/html_example.html", writer="html")
240+
# ani.save(filename="/tmp/html_example.htm", writer="html")
241+
# ani.save(filename="/tmp/html_example.png", writer="html")
242+
#
243+
# FFMpegWriter - Since the frames are piped out to ffmpeg, this option supports
244+
# all formats supported by ffmpeg::
245+
#
246+
# ani.save(filename="/tmp/ffmpeg_example.mkv", writer="ffmpeg")
247+
# ani.save(filename="/tmp/ffmpeg_example.mp4", writer="ffmpeg")
248+
# ani.save(filename="/tmp/ffmpeg_example.mjpeg", writer="ffmpeg")
249+
#
250+
# Imagemagick writers::
251+
#
252+
# ani.save(filename="/tmp/imagemagick_example.gif", writer="imagemagick")

0 commit comments

Comments
 (0)