Skip to content

scale_z_continuous

scale_z_continuous(
    name: str | None = None,
    *,
    breaks: Breaks | None = None,
    break_width: Number | None = None,
    labels: Labels | None = None,
    limits: Limits | None = None,
    expand: Sequence[Number] | None = None,
    na_value: Number | None = None,
    trans: Transform | None = None,
    format: str | None = None,
) -> FeatureSpec

Continuous position scale z: the vertical axis of coord_3d().

Neither lets-plot nor ggplot2 has a z position scale; this one takes the options of scale_x_continuous that make sense for the 3D box.

Parameters:

  • name (str, default: None ) –

    Axis title (labs(z=...) takes precedence).

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

    Fixed break positions in data units; breaks outside the axis are dropped.

  • break_width (float, default: None ) –

    Distance between breaks, in transformed units. breaks take precedence.

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

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

  • limits (list, default: None ) –

    [low, high] in data units; None leaves a side free.

  • expand (list, default: None ) –

    [multiplicative] or [multiplicative, additive] expansion.

  • na_value (float, default: None ) –

    Height where missing values, and values outside limits, are drawn; by default they are dropped.

  • trans (str, default: None ) –

    Transformation of the data: identity, log10, log2, log, log1p, exp, logit, probit, reciprocal, pseudo_log, symlog, sqrt, reverse, or boxcox_trans(p).

  • format (str, default: None ) –

    Label format, as in scale_x_continuous.

Returns:

  • FeatureSpec –

    Scale specification.

Examples:

>>> from ggrust import *
>>> data = {"x": [1, 2, 3, 4], "y": [2, 1, 4, 3], "height": [10, 40, 20, 30]}
>>> plot = ggplot(data, aes("x", "y", z="height")) + geom_point() + coord_3d()
>>> plot = plot + scale_z_continuous("Height (m)", breaks=[10, 20, 30, 40])