Created
November 12, 2013 19:28
-
-
Save wabarr/7437164 to your computer and use it in GitHub Desktop.
code to make an image with nice texture in ggplot
This file contains 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
library(ggplot2) | |
library(reshape2) | |
n <- 7000 | |
theMean <- 0 | |
theSD <- 5 | |
A <- rbinom(n,1,c(.5,.5)) + rnorm(n,theMean,theSD) | |
B <- rbinom(n,1,c(.5,.5)) + rnorm(n,theMean,theSD) | |
C <- rbinom(n,1,c(.5,.5)) + rnorm(n,theMean,theSD) | |
modelID <- 1:n | |
dataFrame <- melt(data.frame(A,B,C,modelID),id="modelID") | |
ggplot(data=dataFrame, aes(x=variable,y=value,group=modelID)) + geom_path(size=.5,alpha=.02) + theme_classic(20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment