@@ -290,22 +290,19 @@ def __init__(self, fps=5, codec=None, bitrate=None, extra_args=None,
290
290
"""
291
291
Parameters
292
292
----------
293
- fps : int
294
- Framerate for movie.
295
- codec : str or None, optional
296
- The codec to use. If ``None`` (the default) :rc:`animation.codec`
297
- is used.
298
- bitrate : int or None, optional
299
- The bitrate for the saved movie file, which is one way to control
300
- the output file size and quality. The default value is ``None``,
301
- which uses :rc:`animation.bitrate`. A value of -1 implies that
302
- the bitrate should be determined automatically by the underlying
303
- utility.
293
+ fps : int, default: 5
294
+ Movie frame rate (per second).
295
+ codec : str or None, default: :rc:`animation.codec`
296
+ The codec to use.
297
+ bitrate : int, default: :rc:`animation.bitrate`
298
+ The bitrate of the movie, in kilobits per second. Higher values
299
+ means higher quality movies, but increase the file size. A value
300
+ of -1 lets the underlying movie encoder select the bitrate.
304
301
extra_args : list of str or None, optional
305
- A list of extra string arguments to be passed to the underlying
306
- movie utility. The default is `` None``, which passes the additional
307
- arguments in :rc:`animation.extra_args` .
308
- metadata : Dict[str, str] or None
302
+ Extra command-line arguments passed to the underlying movie
303
+ encoder. The default, None, means to use
304
+ :rc:`animation.[name-of-encoder]_args` for the builtin writers .
305
+ metadata : Dict[str, str], default: {}
309
306
A dictionary of keys and values for metadata to include in the
310
307
output file. Some keys that may be of use include:
311
308
title, artist, genre, subject, copyright, srcform, comment.
@@ -378,7 +375,7 @@ def _frame_sink(self):
378
375
return self ._proc .stdin
379
376
380
377
def _args (self ):
381
- """Assemble list of utility -specific command-line arguments."""
378
+ """Assemble list of encoder -specific command-line arguments."""
382
379
return NotImplementedError ("args needs to be implemented by subclass." )
383
380
384
381
def cleanup (self ):
@@ -411,9 +408,7 @@ def bin_path(cls):
411
408
412
409
@classmethod
413
410
def isAvailable (cls ):
414
- """
415
- Check to see if a MovieWriter subclass is actually available.
416
- """
411
+ """Return whether a MovieWriter subclass is actually available."""
417
412
return shutil .which (cls .bin_path ()) is not None
418
413
419
414
@@ -978,50 +973,47 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,
978
973
filename : str
979
974
The output filename, e.g., :file:`mymovie.mp4`.
980
975
981
- writer : :class: `MovieWriter` or str, optional
976
+ writer : `MovieWriter` or str, default: :rc:`animation.writer`
982
977
A `MovieWriter` instance to use or a key that identifies a
983
- class to use, such as 'ffmpeg'. If ``None``, defaults to
984
- :rc:`animation.writer` = 'ffmpeg'.
978
+ class to use, such as 'ffmpeg'.
985
979
986
- fps : number , optional
987
- Frames per second in the movie. Defaults to ``None``, which will use
988
- the animation's specified interval to set the frames per second .
980
+ fps : int , optional
981
+ Movie frame rate (per second). If not set, the frame rate from the
982
+ animation's frame interval.
989
983
990
- dpi : number, optional
991
- Controls the dots per inch for the movie frames. This combined with
992
- the figure's size in inches controls the size of the movie. If
993
- ``None``, defaults to :rc:`savefig.dpi`.
994
-
995
- codec : str, optional
996
- The video codec to be used. Not all codecs are supported
997
- by a given :class:`MovieWriter`. If ``None``, default to
998
- :rc:`animation.codec` = 'h264'.
999
-
1000
- bitrate : number, optional
1001
- Specifies the number of bits used per second in the compressed
1002
- movie, in kilobits per second. A higher number means a higher
1003
- quality movie, but at the cost of increased file size. If ``None``,
1004
- defaults to :rc:`animation.bitrate` = -1.
1005
-
1006
- extra_args : list, optional
1007
- List of extra string arguments to be passed to the underlying movie
1008
- utility. If ``None``, defaults to :rc:`animation.extra_args`.
1009
-
1010
- metadata : Dict[str, str], optional
1011
- Dictionary of keys and values for metadata to include in
1012
- the output file. Some keys that may be of use include:
1013
- title, artist, genre, subject, copyright, srcform, comment.
1014
-
1015
- extra_anim : list, optional
1016
- Additional `Animation` objects that should be included
1017
- in the saved movie file. These need to be from the same
1018
- `matplotlib.figure.Figure` instance. Also, animation frames will
1019
- just be simply combined, so there should be a 1:1 correspondence
1020
- between the frames from the different animations.
1021
-
1022
- savefig_kwargs : dict, optional
1023
- Keyword arguments passed to each `~.Figure.savefig` call used to
1024
- save the individual frames.
984
+ dpi : int, default: :rc:`savefig.dpi`
985
+ Controls the dots per inch for the movie frames. Together with
986
+ the figure's size in inches, this controls the size of the movie.
987
+
988
+ codec : str, optional, default: :rc:`animation.codec`.
989
+ The video codec to use. Not all codecs are supported by a given
990
+ `MovieWriter`.
991
+
992
+ bitrate : int, default: :rc:`animation.bitrate`
993
+ The bitrate of the movie, in kilobits per second. Higher values
994
+ means higher quality movies, but increase the file size. A value
995
+ of -1 lets the underlying movie encoder select the bitrate.
996
+
997
+ extra_args : list of str or None, optional
998
+ Extra command-line arguments passed to the underlying movie
999
+ encoder. The default, None, means to use
1000
+ :rc:`animation.[name-of-encoder]_args` for the builtin writers.
1001
+
1002
+ metadata : Dict[str, str], default {}
98AC
1003
+ Dictionary of keys and values for metadata to include in
1004
+ the output file. Some keys that may be of use include:
1005
+ title, artist, genre, subject, copyright, srcform, comment.
1006
+
1007
+ extra_anim : list, default: []
1008
+ Additional `Animation` objects that should be included
1009
+ in the saved movie file. These need to be from the same
1010
+ `matplotlib.figure.Figure` instance. Also, animation frames will
1011
+ just be simply combined, so there should be a 1:1 correspondence
1012
+ between the frames from the different animations.
1013
+
1014
+ savefig_kwargs : dict, default: {}
1015
+ Keyword arguments passed to each `~.Figure.savefig` call used to
1016
+ save the individual frames.
1025
1017
1026
1018
progress_callback : function, optional
1027
1019
A callback function that will be called for every frame to notify
0 commit comments