API reference

andrey.viz.Palette#

class andrey.viz.Palette(paper, surface, surface_2, ink, muted, line, accent, edge_directed, edge_undirected, edge_bidirected, edge_partial, categorical, ramp)[source]#

The colors andrey.viz draws with, for one theme.

andrey.viz.LIGHT and andrey.viz.DARK are the built-in palettes. To match a page with its own colors, build a Palette and pass it to draw() as palette=. Every color is a CSS color string, such as "#3b5bdb". Each parameter is also a read-only attribute of the same name.

Parameters:
  • paper (str) – The background: the canvas of draw() (unless background=False) and of a styled chart. Latent nodes are filled with it, so they read as hollow.

  • surface (str) – The fill of an observed node and of a circle endpoint mark.

  • surface_2 (str) – A second panel color for a page around the figures. draw() and andrey.viz.mpl do not use it.

  • ink (str) – The ring and inside label of an observed node, and a chart’s text, titles, and axis labels.

  • muted (str) – The dashed ring and inside label of a latent node, every label drawn below its node, and a chart’s tick labels.

  • line (str) – A chart’s axis lines and grid lines. draw() does not use it.

  • accent (str) – The ring and mark of each endpoint named in the highlight of draw().

  • edge_directed (str) – Directed edges (->), including both edges of a 2-cycle and self-loops. A neutral gray, so edges with an uncertain orientation stand out.

  • edge_undirected (str) – Undirected edges (--): in a CPDAG, an orientation the data leave open.

  • edge_bidirected (str) – Bidirected edges (<->): in a PAG, a probable latent common cause.

  • edge_partial (str) – Edges with a circle end (o->, -o, o-o) in a PAG.

  • categorical (tuple[str, ...]) – Eight colorblind-safe colors for chart series, in the order to use them; andrey.viz.mpl.cycle() returns them.

  • ramp (tuple[str, ...]) – The colors of andrey.viz.mpl.cmap(), from the lowest value to the highest. The lowest is nearest the background, so low values fade into the page in either theme.