Skip to content

scale_alpha

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

Transparency for alpha: data mapped linearly onto range.

Parameters:

  • range (list of float, default: None ) –

    [lowest, highest] alpha (default 0.1..1).

  • name (str, default: None ) –

    Legend title.

  • breaks (list, default: None ) –

    Values that get a legend key or a colorbar tick.

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

    One label per break (a dict maps breaks to labels).

  • lablim (int, default: None ) –

    Maximum label length in characters; longer labels are cut.

  • limits (list, default: None ) –

    [low, high] data range of a continuous scale, or the levels (and their order) of a discrete one. Data outside the limits gets na_value.

  • na_value (float, default: None ) –

    Value drawn for missing data and data outside limits.

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

    "legend", "colorbar" (continuous color), "none", or a guide_legend() / guide_colorbar() spec.

  • trans ((identity, log10, log2, sqrt, reverse), default: "identity" ) –

    Transformation of the data.

  • format (str, default: None ) –

    Label format: a number format (".2f", ",", "%") or a template ("{.1f} %"). labels take precedence.

Returns:

  • FeatureSpec –

    The scale.