Fits a linear model to chosen conditional quantiles, showing how the spread of y changes with x — not just its mean, as geom_smooth() does.

geom_quantile(
  mapping = NULL,
  data = NULL,
  quantiles = c(0.25, 0.5, 0.75),
  linewidth = NULL,
  alpha = NULL
)

Arguments

mapping, data

Standard layer overrides.

quantiles

Quantiles to fit (default the quartiles).

linewidth, alpha

Appearance.

Value

A Layer to add with +.

Examples

ggnext(cars, aes(speed, dist)) +
  geom_point(alpha = 0.5) +
  geom_quantile()
#> <ggnext plot>
#>   data:  50 x 2
#>   aes:   x = speed, y = dist
#>   layers: 2 
#>   coord: cartesian
#>   mode:  static