Skip to content

geom_ysideviolin

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

Draw violins 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.

Without its own x mapping or constant, x=0 puts one violin in the band, as lets- plot's ggmarginal() does.

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_violin().

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_ysideviolin()