Skip to content

geom_qq_line

geom_qq_line(
    mapping: FeatureSpec | None = None,
    *,
    data: PlotData | None = None,
    stat: str | None = None,
    position: Position | None = None,
    show_legend: bool | None = None,
    inherit_aes: bool | None = None,
    manual_key: ManualKey | None = None,
    sampling: Sampling | None = None,
    tooltips: Tooltips | None = None,
    distribution: Literal | None = None,
    dparams: Sequence[Number] | None = None,
    quantiles: Sequence[Number] | None = None,
    color_by: str | None = None,
    na_rm: bool | None = None,
    **other_args: Any,
) -> LayerSpec

Draw the line through two quantiles of a sample, to read a Q-Q plot against.

Map sample. Computed variables: ..theoretical.. and ..sample...

Parameters:

  • mapping (FeatureSpec, default: None ) –

    Aesthetic mapping from aes().

  • data (DataFrame or dict, default: None ) –

    Layer data; inherits the plot data when None.

  • stat (str, default: "qq_line" ) –

    The statistical transformation.

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

    Position adjustment: a name such as "dodge" or a position_*() spec.

  • show_legend (bool, default: None ) –

    False hides this layer from the legend.

  • inherit_aes (bool, default: None ) –

    False ignores the plot's default mapping for this layer.

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

    The key to show in the manual legend.

  • sampling ((str, int or FeatureSpec), default: None ) –

    Rows to draw: a sampling_*() spec, an int n (sampling_random(n)) or "none". Default: every row.

  • tooltips (FeatureSpec or list of str, default: None ) –

    Tooltip content: layer_tooltips(), a list of column names, or "none".

  • distribution ((norm, uniform, t, gamma, exp, chi2), default: "norm" ) –

    The theoretical distribution.

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

    Its parameters: [mean, std] for "norm" (default [0, 1]), [a, b] for "uniform" ([0, 1]), [degrees of freedom] for "t" and "chi2" ([1]), [alpha, beta] (shape and rate) for "gamma" ([1, 1]), [lambda] for "exp" ([1]).

  • quantiles (list of float, default: [0.25, 0.75] ) –

    The two probabilities the line passes through.

  • color_by (str, default: None ) –

    Aesthetic the color scale applies to.

  • na_rm (bool, default: None ) –

    True removes rows with missing values silently; otherwise with a warning.

  • **other_args (Any) –

    Constant aesthetics such as color="red", size=3.

Returns:

  • LayerSpec –

    The layer.

Examples:

>>> from ggrust import *
>>> data = {"height": [160.0, 172.0, 181.0, 168.0, 175.0], "other": [2.0, 4.0, 3.0, 6.0, 5.0]}
>>> plot = ggplot(data, aes(sample="height")) + geom_qq_line()