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

Skip to content

Commit 36c40f1

Browse files
committed
Be more correct when validating bbox rc params
1 parent 63efe32 commit 36c40f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,10 @@ def validate_bbox(s):
476476
if s == 'standard':
477477
return None
478478
raise ValueError("bbox should be 'tight' or 'standard'")
479+
elif s is not None:
480+
# Backwards compatibility. None is equivalent to 'standard'.
481+
raise ValueError("bbox should be 'tight' or 'standard'")
482+
return s
479483

480484
def validate_sketch(s):
481485
if isinstance(s, six.string_types):
@@ -790,7 +794,7 @@ def __call__(self, s):
790794
# value checked by backend at runtime
791795
'savefig.format': ['png', update_savefig_format],
792796
# options are 'tight', or 'standard'. 'standard' validates to None.
793-
'savefig.bbox': [None, validate_bbox],
797+
'savefig.bbox': ['standard', validate_bbox],
794798
'savefig.pad_inches': [0.1, validate_float],
795799
# default directory in savefig dialog box
796800
'savefig.directory': ['~', six.text_type],

0 commit comments

Comments
 (0)