Skip to content

scale_stroke_identity

scale_stroke_identity(
    name: str | None = None,
    breaks: Breaks | None = None,
    labels: Labels | None = None,
    lablim: int | None = None,
    limits: Limits | None = None,
    na_value: Number | None = None,
    guide: Guide = "none",
    format: str | None = None,
) -> FeatureSpec

Use the data as point outline widths; no legend by default.

Parameters:

  • name (str, default: None ) –

    Title of the scale, shown on the legend.

  • breaks (list or dict, default: None ) –

    Values of the legend keys: a list, or a dict of labels to values.

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

    Texts at the breaks: a list, or a dict of break values to texts.

  • lablim (int, default: None ) –

    Maximum number of characters of a label; longer labels are cut.

  • limits (list, default: None ) –

    Data range of the scale: [low, high] (None keeps a side).

  • na_value (float, default: None ) –

    Outline width used for missing data.

  • guide (str or FeatureSpec, default: 'none' ) –

    Guide: "legend", "none", or a guide_legend() spec.

  • format (str, default: None ) –

    Format pattern of the labels, e.g. ".2f".

Returns:

  • FeatureSpec –

    The scale.

Examples:

>>> from ggrust import *
>>> data = {"x": [1, 2, 3], "y": [1, 2, 3], "outline": [0.5, 1.5, 3]}
>>> plot = ggplot(data, aes("x", "y", stroke="outline"))
>>> plot = plot + geom_point(shape=21, size=5, fill="white") + scale_stroke_identity()