Hi
Deepayan Sarkar wrote:
On Thursday 07 October 2004 08:55, Berwin A Turlach wrote:
G'day all,
I am not sure whether I should file this as a bug report, but I thought that I should make the developers of R aware of the following feature:
I have just installed R 2.0.0 and when I run "R CMD check" on the source of some packages, I noticed that the XXX-examples.ps file contains one page with two graphics overlaid. This seems to happen when the first graphic is produced that uses the lattice() package. I.e. as long as the examples use non-lattice graphics command, each graphic is on its own page; the first graphic produced by a lattice command (well, xyplot each time in the packages tested) is put on the same page as the last graphic, after this, each graphic is again on a page off its own regardless of whether it was produced by a lattice graphics command or a non-lattice graphics command.
I can confirm this, e.g. with
postscript() plot(1) xyplot(2 ~ 2) dev.off()
(not that obvious on screen because the dark background overwrites the first plot). The underlying reason seems to be grid not knowing whether to start a new page the first time:
x11() plot(1) grid.newpage() grid.points(x = runif(10), y = runif(10), vp = viewport())
Paul, any ideas?
Yep, it's grid causing the problem. The very first grid.newpage() on a device will not start a new page IF a traditional plot had previously been drawn on the device. This will be fixed for 2.0.1.
In the meantime, there is a simple workaround for users. On a screen device, the effect will probably not be noticed (as one of Deepayan's examples demonstrates). On a file device like PostScript, it may mean people have to rerun code and insert a grid.newpage() before the first lattice call.
Apologies for the botch-up.
Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] http://www.stat.auckland.ac.nz/~paul/
______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-devel