Skip to content

Commit bec0a4a

Browse files
committed
allow any string for rcParams['savefig.format'], leave validity check until runtime
add docstring
1 parent 8cdc0da commit bec0a4a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/matplotlib/backend_bases.py

+4
Original file line numberDiff line numberDiff line change
@@ -1901,6 +1901,10 @@ def get_supported_filetypes(self):
19011901
return self.filetypes
19021902

19031903
def get_supported_filetypes_grouped(self):
1904+
"""Return a dict of savefig file formats supported by this backend,
1905+
where the keys are a file type name, such as 'Joint Photographic
1906+
Experts Group', and the values are a list of filename extensions used
1907+
for that filetype, such as ['jpg', 'jpeg']."""
19041908
groupings = {}
19051909
for ext, name in self.filetypes.iteritems():
19061910
groupings.setdefault(name, []).append(ext)

lib/matplotlib/rcsetup.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,6 @@ def validate_font_properties(s):
254254
def deprecate_savefig_extension(value):
255255
warnings.warn("savefig.extension is deprecated. Use savefig.format instead.")
256256

257-
validate_savefig_format = ValidateInStrings('savefig_format',
258-
['png', 'ps', 'pdf', 'svg'],
259-
ignorecase=True)
260-
261257
validate_ps_papersize = ValidateInStrings('ps_papersize',[
262258
'auto', 'letter', 'legal', 'ledger',
263259
'a0', 'a1', 'a2','a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10',
@@ -550,7 +546,7 @@ def __call__(self, s):
550546
'savefig.edgecolor' : ['w', validate_color], # edgecolor; white
551547
'savefig.orientation' : ['portrait', validate_orientation], # edgecolor; white
552548
'savefig.extension' : ['png', deprecate_savefig_extension], # what to add to extensionless filenames
553-
'savefig.format' : ['png', validate_savefig_format],
549+
'savefig.format' : ['png', str], # value checked by backend at runtime
554550

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

0 commit comments

Comments
 (0)