Created
October 1, 2013 13:58
-
-
Save epijim/6778848 to your computer and use it in GitHub Desktop.
stacked histogram
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plot using ggplot2 | |
require(ggplot2) | |
#data | |
set.seed(1233) | |
data1 <- data.frame(pop =c(rep("A x B", 200), rep("A x C", 200), rep("B x C", 200) ) , var1 = c(rnorm(1000, 90,10), rnorm(1000, 50, 10), rnorm(1000, 20, 30))) | |
qplot( var1, data = data1, geom = "histogram" , group = pop, fill = pop, alpha=.3) + theme_bw( ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment