KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've got a nifty pair of probability density functions I created with ggplot2 as follows: require(ggplot2) set.seed(2) data <- rbind( data.frame(type="a", lr=rnorm(100)), data.frame(type="b", lr=rnorm(100,.5,1.2))) m <- ggplot(data, aes(x=lr)) m <- m + geom_density(aes(fill=factor(type)), size=2, alpha=.4) m and that produces a nice plot: However I would really like that plot to have different color shading. I can't seem to figure it out. I thought the following would work: m + scale_colour_manual( values = c("red","blue")) But no luck. I also tried passing fill colors to the geom_density() call, to no avail. How do I change the fill colors?
Tags (comma-separated)
Save Edits
Cancel