plotnine.composition.plot_annotation

plot_annotation(
    *, title=None, subtitle=None, caption=None, footer=None, theme=theme()
)

Annotate a composition

This applies to only the top-level composition. When a composition with an annotation is added to larger composition, the annotation of the sub-composition becomes irrelevant.

Parameter Attributes

title: str | None = None

The title of the composition

subtitle: str | None = None

The subtitle of the composition

caption: str | None = None

The caption of the composition

footer: str | None = None

The footer of the composition

theme: theme = field(default_factory=theme) # pyright: ignore[reportUnboundVariable]

Theme for the plot title, subtitle, caption, footer, margin and background

It also controls the figure_size of the composition. The default theme is the same as the default one used for the plots, which you can change with theme_set.

Methods

Name Description
empty Whether the annotation has any content
update Update this annotation with the contents of other

empty

empty()

Whether the annotation has any content

update

update(other)

Update this annotation with the contents of other