Yes, the argument trim=TRUE
does exactly this:
ggplot(mtcars)+
geom_point(aes(y=mpg, x=wt,col=factor(cyl)))+
geom_density(aes(x=wt,y=..scaled..*30,col=factor(cyl)), trim=TRUE)
This is documented in ?stat_density.
--
Check out our R resources at http://www.noamross.net/davis-r-users-group.html
---
You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to davis-rug+...@googlegroups.com.
Visit this group at http://groups.google.com/group/davis-rug.
For more options, visit https://groups.google.com/d/optout.