Input conversions
Our plotting functions forward their documented arguments to the underlying Python functions, where necessary transparently converting acceptable Julia types to the following corresponding Python types.
DataTree arguments
Wherever a Python function accepts a DataTree, pass one of:
These are transparently converted to a Python xarray.DataTree.
Pre-1.0 arviz used to auto-convert other inputs internally — bare numeric arrays, NamedTuples of arrays, raw Dicts of arrays. If you have one of these looser types, convert it to one of the above DataTree-like types explicitly first, e.g. with InferenceObjects.convert_to_inference_data.
dict of {str: DataTree} arguments (multi-model comparison)
Functions whose docstring also documents a dict-of-DataTree form (e.g. plot_dist, plot_forest, combine_plots) additionally accept an AbstractDict whose values are each one of the DataTree-like types above; the keys become model names. plot_forest/plot_ridge also accept a plain Vector/Tuple of such values, naming them positionally ("model1", "model2", ...).
DataArray arguments
Wherever a docstring documents an argument as a raw xarray.DataArray (e.g. plot_pair_focus's focus_var), pass a DimensionalData.AbstractDimArray; its dimension names and coordinates are preserved in the conversion.
Result-object arguments
A few functions take a specific Python type produced by another arviz function rather than a DataTree:
plot_khataccepts the result ofPosteriorStats.loo(aPosteriorStats.PSISLOOResult).plot_compareaccepts the result ofPosteriorStats.compare(aPosteriorStats.ModelComparisonResult).
Everything else
Arguments not covered above (var_names, coords, backend, etc.) are converted generically:
Symbols become Pythonstrs.NamedTuple/Dictbecome Pythondicts.Vector/Tuplebecome Pythonlist/tuples.- numeric arrays become NumPy arrays.
A PythonCall.Py object is always passed through unchanged, so you can build an argument with arviz/arviz_plots/xarray Python calls directly if needed.