Skip to content

shading in line plots

1 message · Mulholland, Tom

#
I have snippets of code that I have either taken from examples or off of the list. I apologise to those I have stolen it from but I didn't keep the proper references.


n <- 100
xx <- c(0:n, n:0)
yy <- c(c(0,cumsum(rnorm(n))), rev(c(0,cumsum(rnorm(n)))))
plot   (xx, yy, type="n", xlab="Time", ylab="Distance")
polygon(xx, yy, col="gray", border = "red")
title("Distance Between Brownian Motions")

The list also has

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/12463.html
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/16809.html
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/0047.html


Tom