Is it possible to plot a graph into several output devices at once? I tried:
getwd()
pdf("level1.pdf")
pdf("level2.pdf")
png("level3.png")
x=1:10
y=1:10
plot(x, y)
dev.off() # close level3
dev.off() # close level2
a=10:20
b=-10:0
plot(a,b)
dev.off() # close level1
The XY plot goes only into level3.png
. (I should go into all 3 files)
Strangely, the AB plot goes into level2.pdf, whie I expected it to be written to level1.pdf, since level2.pdf should be already closed?
ggsave
is even more convenient. – Hillier