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

Skip to content

Add rcfile function (which loads rc params from a given file). #861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 19, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add rcfile (loads parameters from a file).
  • Loading branch information
Matthew Emmett authored and memmett committed Aug 19, 2012
commit ceb66d46e4585cf16aeafab5dfec98475be7969e
13 changes: 13 additions & 0 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -898,6 +904,13 @@ def rcdefaults():
"""
rcParams.update(rcParamsDefault)

def rcfile(fname):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename this to rc_file, to be PEP8 compliant and consistent with the other functions around it

"""
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
Expand Down