MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / rc_params_from_file

Function rc_params_from_file

lib/matplotlib/__init__.py:953–986  ·  view source on GitHub ↗

Construct a `RcParams` from file *fname*. Parameters ---------- fname : str or path-like A file with Matplotlib rc settings. fail_on_error : bool If True, raise an error when the parser fails to convert a parameter. use_default_template : bool If Tru

(fname, fail_on_error=False, use_default_template=True)

Source from the content-addressed store, hash-verified

951
952
953def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
954 """
955 Construct a `RcParams` from file *fname*.
956
957 Parameters
958 ----------
959 fname : str or path-like
960 A file with Matplotlib rc settings.
961 fail_on_error : bool
962 If True, raise an error when the parser fails to convert a parameter.
963 use_default_template : bool
964 If True, initialize with default parameters before updating with those
965 in the given file. If False, the configuration class only contains the
966 parameters specified in the file. (Useful for updating dicts.)
967 """
968 config_from_file = _rc_params_in_file(fname, fail_on_error=fail_on_error)
969
970 if not use_default_template:
971 return config_from_file
972
973 with _api.suppress_matplotlib_deprecation_warning():
974 config = RcParams({**rcParamsDefault, **config_from_file})
975
976 if "".join(config['text.latex.preamble']):
977 _log.info("""
978*****************************************************************
979You have the following UNSUPPORTED LaTeX preamble customizations:
980%s
981Please do not ask for support with these customizations active.
982*****************************************************************
983""", '\n'.join(config['text.latex.preamble']))
984 _log.debug('loaded rc file %s', fname)
985
986 return config
987
988
989rcParamsDefault = _rc_params_in_file(

Callers 4

useFunction · 0.90
_read_style_directoryFunction · 0.90
rc_paramsFunction · 0.85
rc_fileFunction · 0.85

Calls 3

_rc_params_in_fileFunction · 0.85
RcParamsClass · 0.85
joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…