plotnine.facet_wrap

facet_wrap(
    facets=None,
    *,
    nrow=None,
    ncol=None,
    scales="fixed",
    shrink=True,
    labeller="label_value",
    as_table=True,
    drop=True,
    dir="h"
)

Wrap 1D Panels onto 2D surface

Parameters

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

Variables to groupby and plot on different panels. If a string formula is used it should be right sided, e.g "~ a + b", ("a", "b")

nrow : int = None

Number of rows

ncol : int = None

Number of columns

scales : Literal["fixed", "free", "free_x", "free_y"] = "fixed"

Whether x or y scales should be allowed (free) to vary according to the data on each of the panel.

shrink : bool = True

Whether to shrink the scales to the output of the statistics instead of the raw data.

labeller : Literal["label_value", "label_both", "label_context"] = "label_value"

How to label the facets. A string value if it should be one of ["label_value", "label_both", "label_context"].

as_table : bool = True

If True, the facets are laid out like a table with the highest values at the bottom-right. If False the facets are laid out like a plot with the highest value a the top-right

drop : bool = True

If True, all factor levels not used in the data will automatically be dropped. If False, all factor levels will be shown, regardless of whether or not they appear in the data.

dir : Literal["h", "v"] = "h"

Direction in which to layout the panels. h for horizontal and v for vertical.