Interface to plotting backends#

Available backends#

Common interface definition#

Common interface to plotting backends.

Each submodule within this module defines a common interface layer to different plotting libraries.

All other modules in arviz_subplots use this module to interact with the plotting backends, never interacting directly. Thus, adding a new backend requires only implementing this common interface for it, with no changes to any of the other modules.

Throughout the documentation of this module, there are a few type placeholders indicated (e.g. chart type). When implementing a module, these placeholders can be associated to any type of the plotting backend or even custom objects, but all instances of the same placeholder must use the same type (whatever that is).

Keyword arguments

The argument names are defined here to have a comprehensive list of all possibilities. If relevant, a keyword argument present here should be present in the function, and converted in each backend to its corresponding argument in that backend.

This set of arguments doesn’t aim to be complete, only to cover basic properties so the plotting functions can work on multiple backends without duplication. Advanced customization will be backend specific through **kwargs.

target

This module is designed mainly in a functional way. Thus, all functions should take a target argument which indicates on which object should the function be applied to.

color

Color of the visual element. Should also be present whenever facecolor and edgecolor are present, setting the default value for both.

facecolor

Color for filling the visual element.

edgecolor

Color for the edges of the visual element.

alpha

Transparency of the visual element.

width

Width of the visual element itself or of its edges, whichever applies.

size

Size of the visual element.

linestyle

Style of the line plotted.

marker

Marker to be added to the plot.

vertical_align

Vertical alignment between the visual element and the data coordinates provided.

horizontal_align

Horizontal alignment between the visual element and the data coordinates provided.

axis

Data axis (x, y or both) on which to apply the function.

Object creation and I/O#

create_plotting_grid(number[, rows, cols, ...])

Create a chart with a grid of plots in it.

show(chart)

Show this chart.

Geoms#

line(x, y, target, *[, color, alpha, width, ...])

Interface to a line plot.

scatter(x, y, target, *[, size, marker, ...])

Interface to a line plot.

text(x, y, string, target, *[, size, alpha, ...])

Interface to text annotation inside a plot.

Plot appeareance#

title(string, target, *[, size, color])

Interface to adding a title to a plot.

ylabel(string, target, *[, size, color])

Interface to adding a label to a plot's y axis.

xlabel(string, target, *[, size, color])

Interface to adding a label to a plot's x axis.

xticks(ticks, labels, traget, **artist_kws)

Interface to setting ticks and tick labels of the x axis.

yticks(ticks, labels, traget, **artist_kws)

Interface to setting ticks and tick labels of the y axis.

ticklabel_props(target, *[, axis, size, color])

Interface to setting size of tick labels.

remove_ticks(target, *[, axis])

Interface to removing ticks from a plot.

remove_axis(target[, axis])

Interface to removing axis from a plot.

Legend#

legend(target, kwarg_list, label_list[, ...])

Interface to manually generated legends.