I am trying to remove the regression line from geom_smooth and only keep the confidence interval. I have tried size = 0
, size = NULL
, and size = NA
, but none work. Is there a simple workaround that anyone knows?
baseball <- ddply(x, .(id), transform, bat.avg = h/ab)
hank <- subset(baseball, id == 'aaronha01')
ggplot(hank, aes(x = year, y = bat.avg)) +
geom_line(size = 1.2, color = '#336699') +
geom_smooth(fill = '#bf3030', size = NA) +
labs(x = '', y = '')
You can set linetype=0
inside geom_smooth()
to remove line.
ggplot(mtcars,aes(wt,mpg))+geom_smooth(linetype=0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With