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

Skip to content

Commit ceb66d4

Browse files
Matthew Emmettmemmett
Matthew Emmett
authored andcommitted
Add rcfile (loads parameters from a file).
1 parent 2847ad3 commit ceb66d4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/matplotlib/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,12 @@ def rc_params(fail_on_error=False):
716716
warnings.warn(message)
717717
return ret
718718

719+
return rc_params_from_file(fname, fail_on_error)
720+
721+
722+
def rc_params_from_file(fname, fail_on_error=False):
723+
"""Load and return params from fname."""
724+
719725
cnt = 0
720726
rc_temp = {}
721727
with open(fname) as fd:
@@ -898,6 +904,13 @@ def rcdefaults():
898904
"""
899905
rcParams.update(rcParamsDefault)
900906

907+
def rcfile(fname):
908+
"""
909+
Update rc params from file.
910+
"""
911+
rcParams.update(rc_params_from_file(fname))
912+
913+
901914
def rc_file_defaults():
902915
"""
903916
Restore the default rc params from the original matplotlib rc that

0 commit comments

Comments
 (0)