Skip to content

Commit 7afff7f

Browse files
committed
DOC: Add links to supported file formats in animations tutorial
for ffmpeg and imagemagick. Remove last paragraph as it became redundant (see section Animation Writers).
1 parent 312fdb7 commit 7afff7f

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

.flake8

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ per-file-ignores =
8282
tutorials/introductory/pyplot.py: E402, E501
8383
tutorials/introductory/sample_plots.py: E501
8484
tutorials/introductory/quick_start.py: E703
85+
tutorials/introductory/animation_tutorial.py: E501
8586
tutorials/text/annotations.py: E402, E501
8687
tutorials/text/text_intro.py: E402
8788
tutorials/text/text_props.py: E501

tutorials/introductory/animation_tutorial.py

+22-14
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,27 @@ def update(frame):
175175
# Saving Animations
176176
# -----------------
177177
#
178-
# ========================================== ===========================
179-
# Writer Supported Formats
180-
# ========================================== ===========================
181-
# `~matplotlib.animation.PillowWriter` .gif, .apng, .webp
182-
# `~matplotlib.animation.HTMLWriter` .htm, .html, .png
183-
# `~matplotlib.animation.FFMpegWriter` All formats supported by *ffmpeg*
184-
# `~matplotlib.animation.ImageMagickWriter` All formats supported by
185-
# *imagemagick*
186-
# ========================================== ===========================
178+
# .. list-table::
179+
# :header-rows: 1
180+
#
181+
# * - Writer
182+
# - Supported Formats
183+
# * - `~matplotlib.animation.PillowWriter`
184+
# - .gif, .apng, .webp
185+
# * - `~matplotlib.animation.HTMLWriter`
186+
# - .htm, .html, .png
187+
# * - | `~matplotlib.animation.FFMpegWriter`
188+
# | `~matplotlib.animation.FFMpegFileWriter`
189+
# - All formats supported by |ffmpeg|_: ``ffmpeg -formats``
190+
# * - | `~matplotlib.animation.ImageMagickWriter`
191+
# | `~matplotlib.animation.ImageMagickFileWriter`
192+
# - All formats supported by |imagemagick|_: ``magick -list format``
193+
#
194+
# .. _ffmpeg: https://www.ffmpeg.org/general.html#Supported-File-Formats_002c-Codecs-or-Features
195+
# .. |ffmpeg| replace:: *ffmpeg*
196+
#
197+
# .. _imagemagick: https://imagemagick.org/script/formats.php#supported
198+
# .. |imagemagick| replace:: *imagemagick*
187199
#
188200
# To save animations using any of the writers, we can use the
189201
# `.animation.Animation.save` method. It takes the *filename* that we want to
@@ -222,8 +234,4 @@ def update(frame):
222234
# ani.save(filename="apng:/tmp/imagemagick_example.apng",
223235
# writer="imagemagick", extra_args=["-quality", "100"])
224236
#
225-
# (the ``extra_args`` for apng are needed to reduce filesize by ~10x)
226-
#
227-
# Since the frames are piped out to *ffmpeg* or *imagemagick*,
228-
# ``writer="ffmpeg"`` and ``writer="imagemagick"`` support all formats
229-
# supported by *ffmpeg* and *imagemagick*.
237+
# (the ``extra_args`` for *apng* are needed to reduce filesize by ~10x)

0 commit comments

Comments
 (0)