Skip to content

Instantly share code, notes, and snippets.

Created January 11, 2012 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1596476 to your computer and use it in GitHub Desktop.
Save anonymous/1596476 to your computer and use it in GitHub Desktop.
library(ggplot2)
## generate some dummy data
d <- do.call('rbind', sapply(sprintf("Param %02d", 1:9), function(x) {
rbind(data.frame(label=x, klass='pos', value=rnorm(1000)),
data.frame(label=x, klass='neg', value=rnorm(1000, mean=4, sd=2)))
}, simplify=FALSE))
m <- ggplot(d, aes(value, fill = klass)) + geom_density(alpha = 0.2)
m <- m + facet_wrap(~ label, nrow=3, scales='free')
m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment