Skip to content

scale_linewidth_identity

scale_linewidth_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 line 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 ) –

    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" or "{d} px".

Returns:

  • FeatureSpec –

    The scale.

Examples:

>>> from ggrust import *
>>> data = {"x": ["a", "b", "c"], "low": [0, 0, 0], "y": [3, 1, 2], "width": [0.5, 1, 3]}
>>> plot = ggplot(data, aes("x", ymin="low", ymax="y", linewidth="width"))
>>> plot = plot + geom_pointrange(aes(y="y"))
>>> plot = plot + scale_linewidth_identity()