Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
If the user has "savefig.extension : auto" (deprecated) in their (old…
…) matplotlibrc, it will be copied into "savefig.format", where "auto" is not a supported choice. This will fix it so it becomes "png" if it's currently set to "auto". This bug discovered as part of #1530, though it doesn't fix it.
  • Loading branch information
mdboom committed Dec 3, 2012
commit f145b2daa836fce548bbff55b6a127e44120ec93
14 changes: 12 additions & 2 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
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