[R] Base and lattice graphics on the same graphics page

From: John Maindonald <john.maindonald_at_anu.edu.au>
Date: Wed 30 Mar 2005 - 14:32:50 EST

Although base graphics does not mix with lattice in the one graph, I've found that print.trellis(position=..., ) and the use of par(fig=...)
to put regular and trellis graphics on the one graphics page works like a treat, at least in version 2.0.1 of R. [Base graphics functions that are themselves inconsistent with par(fig=...) are obviously disallowed.]

I am wondering whether there are caveats of which I and others should be aware, or whether there is a risk that the ongoing development of R's graphics abilities will render such a cohabitation unworkably fractious.


gph <- bwplot(voice.part ~ height, data=singer) print(gph, position=c(0, 0.5, 1, 1)) # x0, y0, x1, y1 par(fig=c(0, 1, 0,0.5), new=TRUE) # x0, x1, y0, y1 boxplot(height ~ voice.part, data=singer, horiz=TRUE)

John Maindonald email: john.maindonald@anu.edu.au phone : +61 2 (6125)3473 fax : +61 2(6125)5549 Centre for Bioinformation Science, Room 1194, John Dedman Mathematical Sciences Building (Building 27) Australian National University, Canberra ACT 0200.

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 Mar 30 14:47:45 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:57 EST