I would like to make a composite graphic which is 3 panels wide by 8 panels tall. Inside each of the panel would be a graphic that takes multiple R commands to create, like the 1st 3 graphics might be
#1
plot(c(2:20), c(2:20), ylab="", xlab="", axes=FALSE)
par(new=TRUE)
plot(c(1:18, c(1:18), xact="n"), type="l", xlab="", ylab="")
#2
plot(c(2:20), c(2:20), ylab="", xlab="", axes=FALSE)
par(new=TRUE)
plot(c(1:18, c(1:18), xact="n"), type="l", xlab="", ylab="", col=2)
#3
plot(c(2:20), c(2:20), ylab="", xlab="", axes=FALSE, col=3)
par(new=TRUE)
plot(c(1:18, c(1:18), xact="n"), type="l", xlab="", ylab="")
and then I want to use a command like this to display those 3 side by side: grid.arrange(plot1, plot2, plot3)
I don't understand how to save #1, #2, and #3 each to be plot1, plot2 and plot3. Examples of how to save plots all seem to be based on a single plot command, not multiple commands to make the plot. The help page says grob but doesn't explain what an acceptable grob might be, or how to make it. Should I screenshot each of those and save it as a jpeg file?
thanks for any help.