Permalink
Browse files

Add rcfile (loads parameters from a file).

  • Loading branch information...
1 parent 2847ad3 commit ceb66d46e4585cf16aeafab5dfec98475be7969e @memmett committed with May 10, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 lib/matplotlib/__init__.py
@@ -716,6 +716,12 @@ def rc_params(fail_on_error=False):
warnings.warn(message)
return ret
+ return rc_params_from_file(fname, fail_on_error)
+
+
+def rc_params_from_file(fname, fail_on_error=False):
+ """Load and return params from fname."""
+
cnt = 0
rc_temp = {}
with open(fname) as fd:
@@ -898,6 +904,13 @@ def rcdefaults():
"""
rcParams.update(rcParamsDefault)
+def rcfile(fname):
+ """
+ Update rc params from file.
+ """
+ rcParams.update(rc_params_from_file(fname))
+
+
def rc_file_defaults():
"""
Restore the default rc params from the original matplotlib rc that

0 comments on commit ceb66d4

Please sign in to comment.