Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix savefig.extension == "auto" #1537

Merged
merged 1 commit into from Dec 3, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions lib/matplotlib/rcsetup.py
Expand Up @@ -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',
Expand Down Expand Up @@ -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'])
Expand Down Expand Up @@ -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],

Expand Down