arviz_plots.plot_trace#
- arviz_plots.plot_trace(dt, var_names=None, filter_vars=None, group='posterior', coords=None, sample_dims=None, plot_collection=None, backend=None, labeller=None, aes_map=None, plot_kwargs=None, pc_kwargs=None)[source]#
Plot iteration versus sampled values.
- Parameters:
- dt
datatree.DataTree
Input data
- var_names: str or list of str, optional
One or more variables to be plotted. Prefix the variables by ~ when you want to exclude them from the plot.
- filter_vars: {None, “like”, “regex”}, optional, default=None
If None (default), interpret var_names as the real variables names. If “like”, interpret var_names as substrings of the real variables names. If “regex”, interpret var_names as regular expressions on the real variables names.
- sample_dimsiterable, optional
Dimensions to reduce unless mapped to an aesthetic. Defaults to
rcParams["data.sample_dims"]
- plot_collection
PlotCollection
, optional - backend{“matplotlib”, “bokeh”}, optional
- labeller
labeller
, optional - aes_mapmapping, optional
Mapping of artists to aesthetics that should use their mapping in
plot_collection
when plotted. Defaults to only mapping properties to the trace lines.- plot_kwargsmapping of {
str
mapping orFalse
}, optional Valid keys are:
trace -> passed to
line
divergence -> passed to
trace_rug
title ->
labelled_title
xlabel ->
labelled_x
ticklabels ->
ticklabel_props
- pc_kwargsmapping
Passed to
arviz_plots.PlotCollection
- dt
- Returns:
Examples
The following examples focus on behaviour specific to
plot_trace
. For a general introduction to batteries-included functions like this one and common usage examples see Introduction to batteries-included plots in arviz_plotsDefault plot_trace
>>> from arviz_plots import plot_trace, style >>> style.use("arviz-clean") >>> from arviz_base import load_arviz_data >>> centered = load_arviz_data('centered_eight') >>> plot_trace(centered)