DataTaunew | comments | leaders | submitlogin
2 points by larrydag 3510 days ago | link | parent

Really inspired by this visualization. Here is my R method of doing close to the same thing.

xx <- seq(0,4pi,length=512)

df <- do.call(cbind,lapply(1:32, function(i) sin((runif(1)+.5)xx)+1))

df[1,] <- 0

df[nrow(df),] <- 0

plot(x=xx, y=rep(40,length(xx)), ylim=c(0,40), type="n", ylab="")

for(i in 32:1){

  offset <- 1.1*i

  polygon(x=xx, y=offset+df[,i], col="black", border="white")
}

there should be an asterisk for any multiplication operations.




RSS | Announcements