Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
cbook._string_to_bool
1 parent 78e44a6 commit cfd6374Copy full SHA for cfd6374
1 file changed
lib/matplotlib/cbook.py
@@ -788,11 +788,12 @@ def _string_to_bool(s):
788
"""Parses the string argument as a boolean"""
789
if not is_string_like(s):
790
return bool(s)
791
- if s.lower() == 'on':
+ if s.lower() in ['on', 'true']:
792
return True
793
- if s.lower() == 'off':
+ if s.lower() in ['off', 'false']:
794
return False
795
- raise ValueError('String "%s" must be either "on" or "off"' % s)
+ raise ValueError('String "%s" must be one of: '
796
+ '"on", "off", "true", or "false"' % s)
797
798
799
def get_sample_data(fname, asfileobj=True):
0 commit comments