Skip to content

Instantly share code, notes, and snippets.

@wabarr wabarr/texture.R
Created Nov 12, 2013

Embed
What would you like to do?
code to make an image with nice texture in ggplot
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
You can’t perform that action at this time.