Skip to content

scale_fill_gradient

scale_fill_gradient(
    low: Color | None = None,
    high: Color | 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

Map fill to a two-color gradient. See scale_color_gradient.

Parameters:

  • low (str, default: "#132B43", "#56B1F7" ) –

    Colors at the low and high end of the data.

  • high (str, default: "#132B43", "#56B1F7" ) –

    Colors at the low and high end of the data.

  • 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 (str, 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.