Fork me on GitHub

ggplot from ŷhat


Usage

geom_abline(intercept = 15, slope = -1.5)

Arguments

Name Description
intercept y-axis intercept of line to be drawn
slope slope of line to be drawn
color (colour) color of line to be drawn
size width of line to be drawn

Aesthetics

ggplot(mtcars,aes(x='wt',y='mpg')) + \
    geom_point() + \
    geom_abline(intercept=20)
ggplot(mtcars,aes(x='wt',y='mpg')) + \
    geom_point() + \
    geom_abline(intercept=37,slope=-5,
                colour="red",size=10)