diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index bc9a1d89ba43..827ee6f890cb 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -257,6 +257,15 @@ def validate_font_properties(s): def deprecate_savefig_extension(value): warnings.warn("savefig.extension is deprecated. Use savefig.format instead.") + return value + +def update_savefig_format(value): + # The old savefig.extension could also have a value of "auto", but + # the new savefig.format does not. We need to fix this here. + value = str(value) + if value == 'auto': + value = 'png' + return value validate_ps_papersize = ValidateInStrings('ps_papersize',[ 'auto', 'letter', 'legal', 'ledger', @@ -327,7 +336,8 @@ def validate_hinting(s): ['xelatex', 'lualatex', 'pdflatex']) validate_movie_writer = ValidateInStrings('animation.writer', - ['ffmpeg', 'ffmpeg_file', 'mencoder', 'mencoder_file']) + ['ffmpeg', 'ffmpeg_file', 'mencoder', 'mencoder_file', + 'imagemagick', 'imagemagick_file']) validate_movie_frame_fmt = ValidateInStrings('animation.frame_format', ['png', 'jpeg', 'tiff', 'raw', 'rgba']) @@ -566,7 +576,7 @@ def __call__(self, s): 'savefig.edgecolor' : ['w', validate_color], # edgecolor; white 'savefig.orientation' : ['portrait', validate_orientation], # edgecolor; white 'savefig.extension' : ['png', deprecate_savefig_extension], # what to add to extensionless filenames - 'savefig.format' : ['png', str], # value checked by backend at runtime + 'savefig.format' : ['png', update_savefig_format], # value checked by backend at runtime 'savefig.bbox' : [None, validate_bbox], # options are 'tight', or 'standard'. 'standard' validates to None. 'savefig.pad_inches' : [0.1, validate_float],