Update `.rcParams` from file. Style-blacklisted `.rcParams` (defined in ``matplotlib.style.core.STYLE_BLACKLIST``) are not updated. Parameters ---------- fname : str or path-like A file with Matplotlib rc settings. use_default_template : bool If True,
(fname, *, use_default_template=True)
| 1130 | |
| 1131 | |
| 1132 | def rc_file(fname, *, use_default_template=True): |
| 1133 | """ |
| 1134 | Update `.rcParams` from file. |
| 1135 | |
| 1136 | Style-blacklisted `.rcParams` (defined in |
| 1137 | ``matplotlib.style.core.STYLE_BLACKLIST``) are not updated. |
| 1138 | |
| 1139 | Parameters |
| 1140 | ---------- |
| 1141 | fname : str or path-like |
| 1142 | A file with Matplotlib rc settings. |
| 1143 | |
| 1144 | use_default_template : bool |
| 1145 | If True, initialize with default parameters before updating with those |
| 1146 | in the given file. If False, the current configuration persists |
| 1147 | and only the parameters specified in the file are updated. |
| 1148 | """ |
| 1149 | # Deprecation warnings were already handled in rc_params_from_file, no need |
| 1150 | # to reemit them here. |
| 1151 | with _api.suppress_matplotlib_deprecation_warning(): |
| 1152 | from .style.core import STYLE_BLACKLIST |
| 1153 | rc_from_file = rc_params_from_file( |
| 1154 | fname, use_default_template=use_default_template) |
| 1155 | rcParams.update({k: rc_from_file[k] for k in rc_from_file |
| 1156 | if k not in STYLE_BLACKLIST}) |
| 1157 | |
| 1158 | |
| 1159 | @contextlib.contextmanager |
no test coverage detected
searching dependent graphs…