Skip to content

geom_ysidetile

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

Draw tiles 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, the layer is one track labelled by its fill (or color) column: aes(fill="cell_type") draws the track cell_type.

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

Returns:

  • LayerSpec –

    The side layer.

Examples:

>>> from ggrust import *
>>> data = {
...     "cell": ["c1", "c2", "c3", "c4"] * 2,
...     "gene": ["CD3E"] * 4 + ["MS4A1"] * 4,
...     "expression": [2.1, 1.8, 0.2, 0.1, 0.3, 0.1, 2.4, 2.0],
...     "cell_type": ["T", "T", "B", "B"] * 2,
...     "module": ["T genes"] * 4 + ["B genes"] * 4,
... }
>>> plot = (
...     ggplot(data, aes("cell", "gene", fill="expression"))
...     + geom_tile()
...     + new_scale_fill()
...     + geom_ysidetile(aes(fill="module"))
... )