@@ -267,9 +267,24 @@ class MovieWriter(AbstractMovieWriter):
267
267
fig : `~matplotlib.figure.Figure`
268
268
The figure to capture data from.
269
269
This must be provided by the sub-classes.
270
-
271
270
"""
272
271
272
+ # Builtin writer subclasses additionally define the _exec_key and _args_key
273
+ # attributes, which indicate the rcParams entries where the path to the
274
+ # executable and additional command-line arguments to the executable are
275
+ # stored. Third-party writers cannot meaningfully set these as they cannot
276
+ # extend rcParams with new keys.
277
+
278
+ @cbook .deprecated ("3.3" )
279
+ @property
280
+ def exec_key (self ):
281
+ return self ._exec_key
282
+
283
+ @cbook .deprecated ("3.3" )
284
+ @property
285
+ def args_key (self ):
286
+ return self ._args_key
287
+
273
288
def __init__ (self , fps = 5 , codec = None , bitrate = None , extra_args = None ,
274
289
metadata = None ):
275
290
"""
@@ -409,7 +424,7 @@ def bin_path(cls):
409
424
subclass. This is a class method so that the tool can be looked for
410
425
before making a particular MovieWriter subclass available.
411
426
"""
412
- return str (mpl .rcParams [cls .exec_key ])
427
+ return str (mpl .rcParams [cls ._exec_key ])
413
428
414
429
@classmethod
415
430
def isAvailable (cls ):
@@ -573,14 +588,14 @@ class FFMpegBase:
573
588
`MovieWriterBase` sub-class.
574
589
"""
575
590
576
- exec_key = 'animation.ffmpeg_path'
577
- args_key = 'animation.ffmpeg_args'
591
+ _exec_key = 'animation.ffmpeg_path'
592
+ _args_key = 'animation.ffmpeg_args'
578
593
579
594
@property
580
595
def output_args (self ):
581
596
args = ['-vcodec' , self .codec ]
582
597
extra_args = (self .extra_args if self .extra_args is not None
583
- else mpl .rcParams [self .args_key ])
598
+ else mpl .rcParams [self ._args_key ])
584
599
# For h264, the default format is yuv444p, which is not compatible
585
600
# with quicktime (and others). Specifying yuv420p fixes playback on
586
601
# iOS, as well as HTML5 video in firefox and safari (on both Win and
@@ -658,8 +673,8 @@ class AVConvBase(FFMpegBase):
658
673
`MovieWriterBase` sub-class.
659
674
"""
660
675
661
- exec_key = 'animation.avconv_path'
662
- args_key = 'animation.avconv_args'
676
+ _exec_key = 'animation.avconv_path'
677
+ _args_key = 'animation.avconv_args'
663
678
664
679
# NOTE : should be removed when the same method is removed in FFMpegBase.
665
680
isAvailable = classmethod (MovieWriter .isAvailable .__func__ )
@@ -696,8 +711,8 @@ class ImageMagickBase:
696
711
`MovieWriterBase` sub-class.
697
712
"""
698
713
699
- exec_key = 'animation.convert_path'
700
- args_key = 'animation.convert_args'
714
+ _exec_key = 'animation.convert_path'
715
+ _args_key = 'animation.convert_args'
701
716
702
717
@property
703
718
def delay (self ):
@@ -706,7 +721,7 @@ def delay(self):
706
721
@property
707
722
def output_args (self ):
708
723
extra_args = (self .extra_args if self .extra_args is not None
709
- else mpl .rcParams [self .args_key ])
724
+ else mpl .rcParams [self ._args_key ])
710
725
return [* extra_args , self .outfile ]
711
726
712
727
@classmethod
@@ -784,7 +799,7 @@ def _embedded_frames(frame_list, frame_format):
784
799
@writers .register ('html' )
785
800
class HTMLWriter (FileMovieWriter ):
786
801
supported_formats = ['png' , 'jpeg' , 'tiff' , 'svg' ]
787
- args_key = 'animation.html_args'
802
+ _args_key = 'animation.html_args'
788
803
789
804
@classmethod
790
805
def isAvailable (cls ):
0 commit comments