I\'ve made different plots (more than a hundred) for a project and I haven\'t capture them on the way (yes it\'s bad , i know). Now, I need to save them all at once but without
If your plots are 3d, you can take a snapshot of all your plots and save them as a .png file format.
snapshot3d(filename = '../Plots/SnapshotPlots.png', fmt = 'png')
Or else, the best way is to create a multi-paneled plotting window using the par(mfrow)
function. Try the following
plotsPath = "../Plots/allPlots.pdf"
pdf(file=plotsPath)
for (x in seq(1,100))
{
par(mfrow = c(2,1))
p1=rnorm(x)
p2=rnorm(x)
plot(p1,p2)
}
dev.off()
You can also use png
, bmp
, tiff
, and jpeg
functions instead of pdf
. You can read their advantages and disadvantages and choose the one you think is good for your needs.