# Create a set of random trajectories.
x <- matrix(rnorm(10000), 100)
y <- matrix(rnorm(10000), 100)
for(i in seq(100)) {
x[i,] <- cumsum(x[i,])
y[i,] <- cumsum(y[i,])
}
spaghetti(x, y, col=jet.colors)Run the code above in your browser using DataLab