Draws y = intercept + slope * x across the panel. Like geom_hline() and geom_vline() it ignores the plot's aes(), so it never disturbs the data mapping.

geom_abline(
  intercept = 0,
  slope = 1,
  color = NULL,
  linewidth = NULL,
  alpha = NULL,
  dash = NULL
)

Arguments

intercept, slope

Line parameters. slope = 1, intercept = 0 gives the identity line used in agreement and calibration plots.

color, linewidth, alpha, dash

Appearance.

Value

A Layer to add with +.

Examples

ggnext(cars, aes(speed, dist)) +
  geom_point() +
  geom_abline(intercept = 0, slope = 3, dash = "5,4")
#> <ggnext plot>
#>   data:  50 x 2
#>   aes:   x = speed, y = dist
#>   layers: 2 
#>   coord: cartesian
#>   mode:  static