Skip to content

geom_ysidetext

geom_ysidetext(
    mapping: FeatureSpec | None = None, **kwargs: Any
) -> LayerSpec

Draw text labels in the y side panel (R package ggside).

The y side panel sits right of the panel (left with ggside(y_pos="left")) and shares its y axis.

Parameters:

  • mapping (FeatureSpec, default: None ) –

    Aesthetic mapping from aes(). Along y it maps through the main panel's y scale; across the band through the band's own x scale (scale_ysidex_*()).

  • **kwargs (Any) –

    Every other parameter of geom_text().

Returns:

  • LayerSpec –

    The side layer.

Examples:

>>> from ggrust import *
>>> data = {
...     "height": [160, 165, 170, 172, 175, 181, 168, 177],
...     "weight": [55, 61, 66, 70, 72, 80, 63, 75],
...     "sex": ["f", "f", "f", "m", "m", "m", "f", "m"],
... }
>>> plot = ggplot(data, aes("height", "weight")) + geom_point()
>>> plot = plot + geom_ysidetext(aes(label="sex"), x=0)