arviz.plot_parallel

arviz.plot_parallel(data, var_names=None, coords=None, figsize=None, textsize=None, legend=True, colornd='k', colord='C1', shadend=0.025, ax=None, norm_method=None)[source]

Plot parallel coordinates plot showing posterior points with and without divergences.

Described by https://arxiv.org/abs/1709.01449, suggested by Ari Hartikainen

Parameters
dataobj

Any object that can be converted to an az.InferenceData object Refer to documentation of az.convert_to_dataset for details

var_nameslist of variable names

Variables to be plotted, if None all variable are plotted. Can be used to change the order of the plotted variables

coordsmapping, optional

Coordinates of var_names to be plotted. Passed to Dataset.sel

figsizetuple

Figure size. If None it will be defined automatically.

textsize: float

Text size scaling factor for labels, titles and lines. If None it will be autoscaled based on figsize.

legendbool

Flag for plotting legend (defaults to True)

colorndvalid matplotlib color

color for non-divergent points. Defaults to ‘k’

colordvalid matplotlib color

color for divergent points. Defaults to ‘C1’

shadendfloat

Alpha blending value for non-divergent points, between 0 (invisible) and 1 (opaque). Defaults to .025

axaxes

Matplotlib axes.

norm_methodstr

Method for normalizing the data. Methods include normal, minmax and rank. Defaults to none.

Returns
axmatplotlib axes

Examples

Plot default parallel plot

>>> import arviz as az
>>> data = az.load_arviz_data('centered_eight')
>>> az.plot_parallel(data, var_names=["mu", "tau"])
../_images/arviz-plot_parallel-1.png

Plot parallel plot with normalization

>>> az.plot_parallel(data, var_names=["mu", "tau"], norm_method='normal')
../_images/arviz-plot_parallel-2.png