I have got a plot with 3 lines as follows:
a = data.frame(time = c(1:100), x = rnorm(100))
b = data.frame(time = c(1:100), y = rnorm(100))
c = data.frame(time = c(1:100), z = rnorm(100))
plot(a$time, a$x, type = 'l')
lines(b$time, b$y, type = 'l')
lines(c$time, c$z, type = 'l')
I need to fill the area between the lowest and maximum value of the lines so that I get a unique polygon of a given colour.
I know about the polygon
function but I do not know how to use it in this case.
Any suggestion? thanks
See Question&Answers more detail:os