plotnine.element_text

element_text(
    family=None,
    style=None,
    weight=None,
    color=None,
    size=None,
    ha=None,
    va=None,
    rotation=None,
    linespacing=None,
    backgroundcolor=None,
    margin=None,
    **kwargs
)

Theme element: Text

Parameters

family : Optional[str | list[str]] = None

Font family. See set_family for supported values.

style : Optional[str | Sequence[str]] = None

Font style

color : Optional[str | TupleFloat3 | TupleFloat4 | Sequence[str | TupleFloat3 | TupleFloat4]] = None

Text color

weight : Optional[int | str | Sequence[int | str]] = None

Should be one of normal, bold, heavy, light, ultrabold or ultralight.

size : Optional[float | Sequence[float]] = None

text size

ha : Optional[Literal["center", "left", "right"] | float] = None

Horizontal Alignment.

va : Optional[Literal["center", "top", "bottom", "baseline", "center_baseline"] | float] = None

Vertical alignment.

rotation : Optional[Literal["vertical", "horizontal"] | float | Sequence[Literal["vertical", "horizontal"]] | Sequence[float]] = None

Rotation angle in the range [0, 360]

linespacing : float = None

Line spacing

backgroundcolor : Optional[str | TupleFloat3 | TupleFloat4 | Sequence[str | TupleFloat3 | TupleFloat4]] = None

Background color

margin : Optional[dict[Literal["t", "b", "l", "r", "units"], Any]] = None

Margin around the text. The keys are t, b, l, r and units. The tblr keys are floats. The units is one of pt, lines or in. Not all text themeables support margin parameters and other than the units, only some of the other keys may apply.

kwargs : Any = {}

Parameters recognised by Text

Notes

element_text will accept parameters that conform to the ggplot2 element_text API, but it is preferable the Matplotlib based API described above.