plotnine.guide_legend

guide_legend(
    title=None,
    theme=Theme(),
    position=None,
    direction=None,
    reverse=False,
    order=0,
    nrow=None,
    ncol=None,
    byrow=False,
    override_aes=dict()
)

Legend guide

Parameter Attributes

title: Optional[str] = None

Title of the guide. Default is the name of the aesthetic or the name specified using lab

theme: Theme = field(default_factory=Theme)

A theme to style the guide. If None, the plots theme is used.

position: Optional[LegendPosition] = None

Where to place the guide relative to the panels.

direction: Optional[Orientation] = None

Direction of the guide. The default is depends on legend_position.

reverse: bool = False

Whether to reverse the order of the legend keys.

order: int = 0

Order of this guide among multiple guides.

nrow: Optional[int] = None

Number of rows of legends.

ncol: Optional[int] = None

Number of columns of legends.

byrow: bool = False

Whether to fill the legend row-wise or column-wise.

override_aes: dict[str, Any] = field(default_factory=dict)

Aesthetic parameters of legend key.