arviz_plots.PlotMatrix.map_col#
- PlotMatrix.map_col(fun, fun_label=None, index=0, *, data=None, coords=None, ignore_aes='all', subset_info=False, store_artist=True, artist_dims=None, **kwargs)[source]#
Apply the given plotting function along the column with the corresponding aesthetics.
- Parameters:
- fun
callable
Function with signature
fun(da, target, **fun_kwargs)
which should be applied for all combinations of plot and aesthetic. The object returned by fun is assumed to be a scalar unless artist_dims are provided. There is also the option of adding extra required keyword arguments with the subset_info flag.- fun_label
str
, optional Variable name with which to store the object returned by fun. Defaults to
fun.__name__
.- index
int
, default 0 Index of the column to be mapped by the given plotting function.
- data
xarray.Dataset
, optional Data to be subsetted at each iteration and to pass to fun as first positional argument. Defaults to the data used to initialize the
PlotMatrix
.- coordsmapping, optional
Dictionary of {coordinate names : coordinate values} that should be used to subset the aes, data and viz objects before any faceting or aesthetics mapping is applied.
- ignore_aes
str
orset
ofstr
, default “all” Set of aesthetics present in
aes
that should be ignore for thismap
call.- subset_infobool, default
False
Add the subset info from
arviz_base.xarray_sel_iter
to the keyword arguments passed to fun. If true, then fun must accept the keyword argumentsvar_name
,sel
andisel
. Moreover, if those were to be keys present in **kwargs their values in **kwargs would be ignored.- store_artistbool, default
True
- artist_dimsmapping of {hashable
int
}, optional Dictionary of sizes for proper allocation and storage when using
map
with functions that return an array of visual.- **kwargs
Keyword arguments passed as is to fun. Values within **kwargs with
DataArray
ofDataset
type will be subsetted on the current selection (if possible) before calling fun. Slicing with dims and coords is applied to the relevant subset present in the xarray object so dimensions with mapped asethetics not being present is not an issue. However, using Datasets that don’t contain all the variable names indata
will raise an error.
- fun