plotnine.position_dodge2

position_dodge2(width=None, preserve="total", padding=0.1, reverse=False)

Dodge overlaps and place objects side-by-side

This is an enhanced version of position_dodge that can deal with rectangular overlaps that do not share a lower x border.

Parameters

width : Optional[float] = None

Dodging width, when different to the width of the individual elements. This is useful when you want to align narrow geoms with wider geoms

preserve : Literal["total", "single"] = "total"

Should dodging preserve the total width of all elements at a position, or the width of a single element?

padding : float = 0.1

Padding between elements at the same position. Elements are shrunk by this proportion to allow space between them.

reverse : bool = False

Reverse the default ordering of the groups. This is useful if you’re rotating both the plot and legend.