I need to save the plot object in a variable. I know what I can do:
plot(rnorm(10))
obj = recordPlot()
replayPlot(obj)
But I do not want to show the graphics window. So I'm trying to do it, but without success so far.
win.metafile()
plot(rnorm(10))
obj = recordPlot()
dev.off()
replayPlot(obj)
Well, probably because when I do the obj = recordPlot()plot is not ready yet.
source
share