1- ======================
2- `` animation `` module
3- ======================
1+ *********
2+ animation
3+ *********
44
55.. automodule :: matplotlib.animation
66 :no-members:
1111 :local:
1212 :backlinks: entry
1313
14-
1514Animation
1615=========
1716
@@ -37,7 +36,6 @@ To save an animation to disk use `Animation.save` or `Animation.to_html5_video`
3736See :ref: `ani_writer_classes ` below for details about what movie formats are
3837supported.
3938
40-
4139``FuncAnimation ``
4240-----------------
4341
@@ -48,7 +46,6 @@ The inner workings of `FuncAnimation` is more-or-less::
4846 fig.canvas.draw_idle()
4947 fig.canvas.start_event_loop(interval)
5048
51-
5249with details to handle 'blitting' (to dramatically improve the live
5350performance), to be non-blocking, not repeatedly start/stop the GUI
5451event loop, handle repeats, multiple animated axes, and easily save
@@ -122,71 +119,66 @@ artist at a global scope and let Python sort things out. For example ::
122119 init_func=init, blit=True)
123120 plt.show()
124121
125-
126122The second method is to us `functools.partial ` to 'bind' artists to
127123function. A third method is to use closures to build up the required
128124artists and functions. A fourth method is to create a class.
129125
130-
131-
132-
133126Examples
134127~~~~~~~~
135128
136129.. toctree ::
137130 :maxdepth: 1
138131
139132 ../gallery/animation/animate_decay
140- ../gallery/animation/bayes_update_sgskip
141- ../gallery/animation/double_pendulum_animated_sgskip
142- ../gallery/animation/dynamic_image
133+ ../gallery/animation/bayes_update
134+ ../gallery/animation/double_pendulum_sgskip
143135 ../gallery/animation/histogram
144136 ../gallery/animation/rain
145- ../gallery/animation/random_data
146- ../gallery/animation/simple_3danim
137+ ../gallery/animation/random_walk
147138 ../gallery/animation/simple_anim
148- ../gallery/animation/strip_chart_demo
139+ ../gallery/animation/strip_chart
149140 ../gallery/animation/unchained
150141
151142``ArtistAnimation ``
152143-------------------
153144
154-
155145Examples
156146~~~~~~~~
157147
158148.. toctree ::
159149 :maxdepth: 1
160150
161- ../gallery/animation/basic_example
162- ../gallery/animation/basic_example_writer_sgskip
163- ../gallery/animation/dynamic_image2
164-
165-
166-
151+ ../gallery/animation/dynamic_image
167152
168153Writer Classes
169154==============
170155
156+ The provided writers fall into a few broad categories.
171157
172-
173- The provided writers fall into two broad categories: pipe-based and
174- file-based. The pipe-based writers stream the captured frames over a
175- pipe to an external process. The pipe-based variants tend to be more
176- performant, but may not work on all systems.
158+ The Pillow writer relies on the Pillow library to write the animation, keeping
159+ all data in memory.
177160
178161.. autosummary ::
179162 :toctree: _as_gen
180163 :nosignatures:
181164
165+ PillowWriter
166+
167+ The pipe-based writers stream the captured frames over a pipe to an external
168+ process. The pipe-based variants tend to be more performant, but may not work
169+ on all systems.
170+
171+ .. autosummary ::
172+ :toctree: _as_gen
173+ :nosignatures:
182174
183175 FFMpegWriter
184176 ImageMagickFileWriter
185177 AVConvWriter
186178
187- Alternatively the file-based writers save temporary files for each
188- frame which are stitched into a single file at the end. Although
189- slower, these writers can be easier to debug.
179+ The file-based writers save temporary files for each frame which are stitched
180+ into a single file at the end. Although slower, these writers can be easier to
181+ debug.
190182
191183.. autosummary ::
192184 :toctree: _as_gen
@@ -196,7 +188,6 @@ slower, these writers can be easier to debug.
196188 ImageMagickWriter
197189 AVConvFileWriter
198190
199-
200191Fundamentally, a `MovieWriter ` provides a way to grab sequential frames
201192from the same underlying `~matplotlib.figure.Figure ` object. The base
202193class `MovieWriter ` implements 3 methods and a context manager. The
@@ -215,45 +206,39 @@ file to disk. For example ::
215206 moviewriter.grab_frame()
216207 moviewriter.finish()
217208
218-
219- If using the writer classes directly (not through `Animation.save `), it is strongly encouraged
220- to use the `~MovieWriter.saving ` context manager ::
209+ If using the writer classes directly (not through `Animation.save `), it is
210+ strongly encouraged to use the `~MovieWriter.saving ` context manager ::
221211
222212 with moviewriter.saving(fig, 'myfile.mp4', dpi=100):
223213 for j in range(n):
224214 update_figure(n)
225215 moviewriter.grab_frame()
226216
227-
228217to ensures that setup and cleanup are performed as necessary.
229218
219+ Examples
220+ --------
230221
231- :ref: `sphx_glr_gallery_animation_moviewriter_sgskip.py `
222+ .. toctree ::
223+ :maxdepth: 1
232224
225+ ../gallery/animation/frame_grabbing_sgskip
233226
234227.. _ani_writer_classes :
235228
236229Helper Classes
237230==============
238231
239-
240232Animation Base Classes
241233----------------------
242234
243-
244235.. autosummary ::
245236 :toctree: _as_gen
246237 :nosignatures:
247238
248239 Animation
249240 TimedAnimation
250241
251-
252- Custom Animation classes
253- ------------------------
254-
255- :ref: `sphx_glr_gallery_animation_subplots.py `
256-
257242Writer Registry
258243---------------
259244
@@ -280,7 +265,7 @@ To reduce code duplication base classes
280265 MovieWriter
281266 FileMovieWriter
282267
283- and mixins are provided
268+ and mixins
284269
285270.. autosummary ::
286271 :toctree: _as_gen
@@ -290,9 +275,9 @@ and mixins are provided
290275 FFMpegBase
291276 ImageMagickBase
292277
293- See the source code for how to easily implement new `MovieWriter `
294- classes.
278+ are provided.
295279
280+ See the source code for how to easily implement new `MovieWriter ` classes.
296281
297282Inheritance Diagrams
298283====================
0 commit comments