arviz_plots.PlotMatrix.map_triangle#
- PlotMatrix.map_triangle(fun, fun_label=None, *, data=None, loop_data=None, triangle='both', coords=None, ignore_aes=frozenset({}), subset_info=False, store_artist=True, artist_dims=None, **kwargs)[source]#
Apply the given plotting function to all plots with the corresponding aesthetics.
- Parameters:
- fun
callable
Function with signature
fun(da_x, da_y, target, **fun_kwargs)
which should be called for all couples of data pairs (each couple encoded in a plot) and corresponding aesthetic. The object returned by fun is assumed to be an scalar unless artist_dims are provided. There is also the option of adding extra keyword arguments with the subset_info flag.- fun_label
str
, optional Function identifier. It will be used as variable name to store the object returned by fun. Defaults to
fun.__name__
.- data
xarray.Dataset
, optional Data to be subsetted into pair elements then loop to cover all couple combinations. Defaults to the data used to initalize the
PlotMatrix
.- loop_data
xarray.Dataset
orstr
TODO: see if it works and if we want to keep it.
- 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
set
, optional 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
for theda_x``+``da_y
couple to the keyword arguments passed to fun. If true, then fun must accept the keyword argumentsvar_name_x
,sel_x
,isel_x
,var_name_y
,sel_y
andisel_y
. 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
Extra keyword arguments to be passed to fun.
- fun