Interface to plotting backends#
Available backends#
Common interface arguments#
Common interface to plotting backends.
Each submodule within this module defines a common interface layer to different plotting libraries.
Outside arviz_plots.backend the corresponding backend module is imported,
but only the common interface layer is used, making no distinctions between plotting backends.
Each submodule inside arviz_plots.backend is expected to implement the same functions
with the same call signature. Thus, adding a new backend requires only
implementing this common interface for it, with no changes to any of the other modules.
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
targetargument which indicates on which object should the function be applied to.- color
Color of the visual element. Should also be present whenever
facecolorandedgecolorare 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. Needs to accept | as a valid value.
- rotation
Rotation of axis labels in degrees.
- 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.
Common interface functions#
Object creation and I/O#
Geoms#
|
Interface to a vertical interval line at a given x position. |
|
Fill the region between two y-values. |
|
Interface to a histogram bar plot. |
|
Interface to a horizontal reference line. |
|
Interface to a horizontal shaded region. |
|
Interface to a line plot. |
|
Interface to multiple line plots. |
|
Interface to a scatter plot. |
|
Interface to a step line plot. |
|
Interface to a text annotation inside a plot. |
|
Interface to a vertical reference line. |
|
Interface to a vertical shaded region. |
Plot appearance#
|
Interface to a grid. |
|
Interface to removing ticks from a plot. |
|
Interface to removing an axis from a plot. |
|
Interface to setting tick label visibility. |
|
Interface to setting the y-axis scale of a plot. |
|
Interface to tick label properties. |
|
Interface to a title. |
|
Interface to an x-axis label. |
|
Interface to x-axis ticks. |
|
Interface to a y-axis label. |
|
Interface to y-axis ticks. |
Legend#
|
Generate a legend on a figure given lists of labels and property kwargs. |
Helper functions#
Get the background color of active style. |
|
|
Generate n default values for a given aesthetics keyword. |
|
Scale figure properties according to figsize, rows and cols. |