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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
allow any string for rcParams['savefig.format'], leave validity check…
… until runtime

add docstring
  • Loading branch information
mspacek committed Jun 3, 2012
commit bec0a4a794d1c9bd3a5500e4ffd44395d36fb851
4 changes: 4 additions & 0 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,10 @@ def get_supported_filetypes(self):
return self.filetypes

def get_supported_filetypes_grouped(self):
"""Return a dict of savefig file formats supported by this backend,
where the keys are a file type name, such as 'Joint Photographic
Experts Group', and the values are a list of filename extensions used
for that filetype, such as ['jpg', 'jpeg']."""
groupings = {}
for ext, name in self.filetypes.iteritems():
groupings.setdefault(name, []).append(ext)
Expand Down
6 changes: 1 addition & 5 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,6 @@ def validate_font_properties(s):
def deprecate_savefig_extension(value):
warnings.warn("savefig.extension is deprecated. Use savefig.format instead.")

validate_savefig_format = ValidateInStrings('savefig_format',
['png', 'ps', 'pdf', 'svg'],
ignorecase=True)

validate_ps_papersize = ValidateInStrings('ps_papersize',[
'auto', 'letter', 'legal', 'ledger',
'a0', 'a1', 'a2','a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10',
Expand Down Expand Up @@ -550,7 +546,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', validate_savefig_format],
'savefig.format' : ['png', str], # value checked by backend at runtime

'tk.window_focus' : [False, validate_bool], # Maintain shell focus for TkAgg
'tk.pythoninspect' : [False, validate_tkpythoninspect], # obsolete
Expand Down