Skip to content
Prev 229171 / 398500 Next

Adding lines to two graphs alternately

On 07/29/2010 07:02 AM, Dennis Fisher wrote:
Hi Dennis,
You are probably looking for split.screen. You can specify the layout:

split.screen(c(1,2))

make a plot on each screen:
plot(1:5)
screen(2)
plot(5:1)

swap back and forth to add lines

screen(1,FALSE)
lines(c(2,5,4,3,1))
screen(2,FALSE)
lines(c(1,2,5,2,3))

and so on.

Jim