arviz.rc_context#

class arviz.rc_context(rc=None, fname=None)[source]#

Return a context manager for managing rc settings.

Parameters:
rcdict, optional

Mapping containing the rcParams to modify temporally.

fnamestr, optional

Filename of the file containing the rcParams to use inside the rc_context.

Examples

This allows one to do:

with az.rc_context(fname='pystan.rc'):
    idata = az.load_arviz_data("radon")
    az.plot_posterior(idata, var_names=["gamma"])

The plot would have settings from ‘screen.rc’

A dictionary can also be passed to the context manager:

with az.rc_context(rc={'plot.max_subplots': None}, fname='pystan.rc'):
    idata = az.load_arviz_data("radon")
    az.plot_posterior(idata, var_names=["gamma"])

The ‘rc’ dictionary takes precedence over the settings loaded from ‘fname’. Passing a dictionary only is also valid.

Methods