plotnine.composition.guide_area

guide_area(fill=None, alpha=None)

A grid cell that hosts collected guides

Used in a composition that collects guides with plot_layout(guides="collect") to route the merged legend into a cell of the grid instead of placing it on the side of the composition.

Renders empty (like plot_spacer) when no collection is in effect, no guides exist to collect, or another guide_area was selected first.

Parameters

fill : str | tuple[float, float, float] | tuple[float, float, float, float] | None = None

Background color. The default is a transparent area.

alpha : float | None = None

Opacity of the background fill, between 0 (transparent) and 1 (opaque). The default leaves the area transparent.

See Also

plot_spacer

Blank cell with the same styling.

plot_layout

Set guides="collect" to enable collection.