[R] Mixing grid and base graphics--need help understanding this quirk

From: Kevin Wright <kwright68_at_gmail.com>
Date: Wed 28 Jun 2006 - 06:31:02 EST


My setup: Windows 2000, R 2.3.1

When I start a brand new session of R and paste the code below into R, the graphic device shows "Some text" in the lower left corner. If I paste the code into the command window again, then "Some text" does not appear in the lower left corner. Why is this?

require(grid)
par(mfrow=c(1,2))
plot(1:10)
plot(-10:1)
par(mfrow=c(1,1))
pushViewport(viewport(.04, .04, width=stringWidth("Some text"),
height=unit(2,"lines"),

                      name="pagenum", gp=gpar(fontsize=10)))
grid.text("Some text", gp=gpar(col="gray30"),
          just=c("left","bottom"))

popViewport()

Kevin Wright



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jun 28 07:49:56 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 29 Jun 2006 - 20:12:21 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.