Skip to content

scale_size_radius

scale_size_radius(
    range: Sequence[Number] = (1, 6),
    name: str | None = None,
    breaks: Breaks | None = None,
    labels: Labels | None = None,
    limits: Limits | None = None,
    na_value: Number | None = None,
    guide: Guide | None = None,
    trans: Transform | None = None,
    format: str | None = None,
) -> FeatureSpec

Map continuous size linearly onto the point radius.

As ggplot2 scale_radius and plotnine scale_size_radius: the diameter, not the area, grows linearly with the value. This is the mapping of scale_size (lets-plot), with ggplot2's default range.

Parameters:

  • range (list of float, default: (1, 6) ) –

    [smallest, largest] size.

  • name (str, default: None ) –

    Legend title.

  • breaks (list, default: None ) –

    Values that get a legend key.

  • labels (list of str or dict, default: None ) –

    One label per break.

  • limits (list, default: None ) –

    [low, high] data range.

  • na_value (float, default: None ) –

    Size of missing data.

  • guide (str or FeatureSpec, default: None ) –

    "legend", "none", or a guide spec.

  • trans (str, default: None ) –

    Transformation of the data.

  • format (str, default: None ) –

    Label format.

Returns:

  • FeatureSpec –

    The scale.

Examples:

>>> from ggrust import *
>>> data = {"x": [1, 2, 3, 4], "y": [3, 1, 4, 2], "people": [10, 200, 50, 800]}
>>> plot = ggplot(data, aes("x", "y", size="people")) + geom_point()
>>> plot = plot + scale_size_radius(range=[2, 10])