[R] more mulitpage postscript problems
Wilkinson, Mark
Mark.Wilkinson at stjude.org
Fri Feb 21 22:03:03 CET 2003
Doh!
The second loop should be
for (j in i:min(i+3, 16)) {
Thanks for the help!
Mark Wilkinson
Informatics Analyst
St. Jude Children's Research Hospital
Department of Pharmaceutical Sciences
The opinions expressed here are my own and do not necessarily represent
those of St. Jude Children's Research Hospital.
-----Original Message-----
From: Michael Na Li [mailto:lina at u.washington.edu]
Sent: Friday, February 21, 2003 2:53 PM
To: Wilkinson, Mark
Subject: Re: [R] more mulitpage postscript problems
On Fri, 21 Feb 2003, Mark Wilkinson stated:
>
> tmp <- matrix(runif(16000), nrow=16)
> ##postscript(paper='letter')
> for (i in seq(1, 16, 4)) {
> X11()
> par(mfrow=c(2, 2))
> for (j in 1:min(i+3, 16)) {
> plot(density(tmp[j, ], from=0, to=1), lwd=3, main=paste(i, j))
> }
> }
> ##dev.off()
>
> When I run as is, I get what I want: four 'pages', 4 plots each. But
when
> I comment X11(), and uncomment the first and last lines, the postscript
> file I get has 10 pages!
You do have 40 plots so you should get 10 pages with 4 plots on each page.
However, X11() is only called 4 times that is why you only have four
plot windows popping up. Pages plotted on the same plot window will
override
previous pages, for obvious reasons.
Michael
More information about the R-help
mailing list