Skip to content

label_both

label_both(
    *,
    multi_line: bool | None = None,
    sep: str | None = None,
) -> Labeller

Label facet strips with variable: value.

Call it to change options: label_both(sep=" = "), or label_both(multi_line=False) for one strip ("cyl, drv: 4, f").

Examples:

>>> from ggrust import *
>>> data = {"age": [1, 3, 2, 4], "weight": [4, 6, 8, 12], "pet": ["cat", "cat", "dog", "dog"]}
>>> plot = ggplot(data, aes("age", "weight")) + geom_point()
>>> plot = plot + facet_wrap("pet", labeller=label_both)