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,54 +119,40 @@ 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
171-
172-
173156The provided writers fall into two broad categories: pipe-based and
174157file-based. The pipe-based writers stream the captured frames over a
175158pipe to an external process. The pipe-based variants tend to be more
@@ -179,7 +162,6 @@ performant, but may not work on all systems.
179162 :toctree: _as_gen
180163 :nosignatures:
181164
182-
183165 FFMpegWriter
184166 ImageMagickFileWriter
185167 AVConvWriter
@@ -196,7 +178,6 @@ slower, these writers can be easier to debug.
196178 ImageMagickWriter
197179 AVConvFileWriter
198180
199-
200181Fundamentally, a `MovieWriter ` provides a way to grab sequential frames
201182from the same underlying `~matplotlib.figure.Figure ` object. The base
202183class `MovieWriter ` implements 3 methods and a context manager. The
@@ -215,45 +196,39 @@ file to disk. For example ::
215196 moviewriter.grab_frame()
216197 moviewriter.finish()
217198
218-
219- If using the writer classes directly (not through `Animation.save `), it is strongly encouraged
220- to use the `~MovieWriter.saving ` context manager ::
199+ If using the writer classes directly (not through `Animation.save `), it is
200+ strongly encouraged to use the `~MovieWriter.saving ` context manager ::
221201
222202 with moviewriter.saving(fig, 'myfile.mp4', dpi=100):
223203 for j in range(n):
224204 update_figure(n)
225205 moviewriter.grab_frame()
226206
227-
228207to ensures that setup and cleanup are performed as necessary.
229208
209+ Examples
210+ --------
230211
231- :ref: `sphx_glr_gallery_animation_moviewriter_sgskip.py `
212+ .. toctree ::
213+ :maxdepth: 1
232214
215+ ../gallery/animation/frame_grabbing_sgskip
233216
234217.. _ani_writer_classes :
235218
236219Helper Classes
237220==============
238221
239-
240222Animation Base Classes
241223----------------------
242224
243-
244225.. autosummary ::
245226 :toctree: _as_gen
246227 :nosignatures:
247228
248229 Animation
249230 TimedAnimation
250231
251-
252- Custom Animation classes
253- ------------------------
254-
255- :ref: `sphx_glr_gallery_animation_subplots.py `
256-
257232Writer Registry
258233---------------
259234
@@ -280,7 +255,7 @@ To reduce code duplication base classes
280255 MovieWriter
281256 FileMovieWriter
282257
283- and mixins are provided
258+ and mixins
284259
285260.. autosummary ::
286261 :toctree: _as_gen
@@ -290,9 +265,9 @@ and mixins are provided
290265 FFMpegBase
291266 ImageMagickBase
292267
293- See the source code for how to easily implement new `MovieWriter `
294- classes.
268+ are provided.
295269
270+ See the source code for how to easily implement new `MovieWriter ` classes.
296271
297272Inheritance Diagrams
298273====================
0 commit comments