I have at least 10 plots by ggplot(we can call them plot1, plot2 ....). I can output them into separate pdf files. But I prefer to output them in only one pdf file but several pages. One page, one plot from ggplot.
I tried to list all plots and use ggsave but it can not work. Any idea or script can help? Thank you
See the pdf
function for this.
For three plots it would look like this (saving into your working directory with default naming). Run through dev.off
line before you can open file.
pdf()
plot1
plot2
plot3
dev.off()
If your plots are already stored in a list named list1
:
pdf()
list1
dev.off()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With