Managers for faceting 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 faceting and aesthetic mapping in our figure to prevent duplication and ensure coherence between the different functions.

PlotCollection#

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[, aes, ...])

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

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

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

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.facet_dims

Dimensions over which one should loop for facetting when using this PlotCollection.

PlotCollection.data

Dataset to be used as data for plotting.

Faceting and aesthetics mapping#

PlotCollection.generate_aes_dt(aes[, data])

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 visual in the viz DataTree.

PlotCollection.get_viz(artist_name[, ...])

Get element from .viz that corresponds to the provided subset.

PlotCollection.get_target(var_name, selection)

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

PlotCollection.show()

Call the backend function to show this figure.

PlotCollection.savefig(filename, **kwargs)

Call the backend function to save this figure.

PlotMatrix#

Object creation#

PlotMatrix(data, facet_dims[, aes, backend, ...])

Low level base class for pairwise matrix arranges of plots.

Plotting#

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

Apply the given plotting function along the diagonal with the corresponding aesthetics.

PlotMatrix.map_triangle(fun[, fun_label, ...])

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

PlotMatrix.map_lower(*args, **kwargs)

Call map_triangle with triangle="lower".

PlotMatrix.map_upper(*args, **kwargs)

Call map_triangle with triangle="upper".

PlotMatrix.map_row(fun[, fun_label, index, ...])

Apply the given plotting function along the row with the corresponding aesthetics.

PlotMatrix.map_col(fun[, fun_label, index, ...])

Apply the given plotting function along the column with the corresponding aesthetics.

Attributes#

PlotMatrix.aes

Information about aesthetic mapping as a DataTree.

PlotMatrix.viz

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

PlotMatrix.aes_set

Return all aesthetics with a mapping defined as a set.

PlotMatrix.facet_dims

Facetting dimensions.

PlotMatrix.data

Dataset to be used as data for plotting.