Managers for facetting and aesthetics mapping

Managers for facetting and aesthetics mapping#

The classes in this module lay at the core of the library, and are consequently available at the arviz_plots top level namespace.

They abstract all information regarding facetting and aesthetic mapping in our chart to prevent duplication and ensure coherence between the different functions.

Object creation#

PlotCollection(data, viz_dt[, aes_dt, aes, ...])

Low level base class for plotting with xarray Datasets.

PlotCollection.grid(data[, cols, rows, ...])

Instatiate a PlotCollection and generate a plot grid iterating over rows and columns.

PlotCollection.wrap(data[, cols, col_wrap, ...])

Instatiate a PlotCollection and generate a plot grid iterating over subsets and wrapping.

Plotting#

PlotCollection.add_legend(dim[, var_name, ...])

Add a legend for the given artist/aesthetic to the plot.

PlotCollection.map(fun[, fun_label, data, ...])

Apply the given plotting function to all plots with the corresponding aesthetics.

PlotCollection.plot_iterator([ignore_aes, ...])

Build a generator to loop over all plots in the PlotCollection.

PlotCollection.show()

Call the backend function to show this chart.

Attributes#

PlotCollection.aes

Information about aesthetic mapping as a DataTree.

PlotCollection.viz

Information about the visual elements in the plot as a DataTree.

PlotCollection.aes_set

Return all aesthetics with a mapping defined as a set.

PlotCollection.base_loop_dims

Dimensions over which one should always loop over when using this PlotCollection.

PlotCollection.data

Dataset to be used as data for plotting.

Facetting and aesthetics mapping#

PlotCollection.generate_aes_dt([aes])

Generate the aesthetic mappings.

PlotCollection.get_aes_as_dataset(aes_key)

Get the values of the provided aes_key for all variables as a Dataset.

PlotCollection.get_aes_kwargs(aes, var_name, ...)

Get the aesthetic mappings for the given variable and selection as a dictionary.

PlotCollection.update_aes([ignore_aes, coords])

Update list of aesthetics after indicating ignores and extra subsets.

PlotCollection.update_aes_from_dataset(...)

Update the values of aes_key with those in the provided Dataset.

Other#

PlotCollection.allocate_artist(fun_label, ...)

Allocate an artist in the viz DataTree.

PlotCollection.get_viz(var_name)

Get the viz Dataset that corresponds to the provided variable.

PlotCollection.get_target(var_name, selection)

Get the target that corresponds to the given variable and selection.