标签:The seed ggplot2 alpha fill ram data log frame
library(ggplot2)
set.seed(1)
vals1 <- rbeta(1000, 0.5, 0.1)
vals2 <- rbeta(1000, 0.25, 0.3)
gg <- ggplot(data.frame(x=c(vals1, vals2),
grp=c(rep("a", 1000), rep("b", 1000))))
gg <- gg + geom_density(aes(x=x, y=..scaled.., fill=grp), alpha=1/2)
gg <- gg + theme_bw()
gg
标签:The seed ggplot2 alpha fill ram data log frame
原文地址:https://www.cnblogs.com/3Dgenome/p/14710595.html