## Boxplots n <- 10 g <- gl(n, 100, n * 100) x <- rnorm(n * 100) + sqrt(codes(g)) boxplot(split(x, g), col = "lavender", notch = TRUE) # Shading between two curves par(bg = "red") n <- 100 x <- c(0, cumsum(rnorm(n))) y <- c(0, cumsum(rnorm(n))) xx <- c(0:n, n:0) yy <- c(x, rev(y)) plot(xx, yy, type = "n", xlab = "Time", ylab = "Distance") polygon(xx, yy, col = "gray") title("Distance Between Brownian Motions")