I have R script which creates 100 plots.
How to create 1 single PDF with 50 pages?
2 plots on each page.I tried using
par(mfrow=(50,2))
but its giving Error in plot.new() : figure margins too large
Asked
Active
Viewed 969 times
-2

Roland
- 127,288
- 10
- 191
- 288

Ajay Jadhav
- 52
- 7
1 Answers
5
you want 2 plots per page, so you need par(mfrow=c(2,1))
. R will automatically switch to the next page if you ask it to plot more than 2 plots.
pdf("myoutput.pdf")
par(mfrow=c(2,1))
for (i in 1:100) {
plot(runif(10)
}
should produce a 50 pages pdf, with 2 plots per page.

xraynaud
- 2,028
- 19
- 29
-
Thanks @xraynaud. Its working. You made my day! – Ajay Jadhav Apr 07 '17 at 08:01