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
)A Layer to add with +.
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