Pikounis, V. Bill
2002-Jun-06 09:48 UTC
[R] Thanks and Summary (was par(new=T) with xyplot)
Thanks very much to Paul Murrell and Frank Harrell for addressing my original query (repeated at end of this note). Paul's helpful suggestion with print.trellis and its more= argument, followed by trellis settings, works precisely as I needed.> # snipped from Paul's reply:> p1 <- xyplot(y ~ x, ylim=c(-5, 5)) > p2 <- xyplot(y2 ~ x, pch=16, ylim=c(-5, 5), ylab=" ") > print.trellis(p1, more=TRUE) > bg <- trellis.par.get("background") > bg$col <- "transparent" > trellis.par.set("background", bg) > print.trellis(p2)One side note: A glitch occurs when I use xYplot() from the Hmisc library instead of xyplot() from lattice. The ylim= argument seems to be ignored in the second plotting call and therefore the y-axes do not line up. (Frank, I can discuss more with you about this off-list to see why this happens.) Thanks again and Best Regards, Bill> -----Original Message----- > From: Pikounis, V. Bill [mailto:v_bill_pikounis at merck.com] > Sent: Wednesday, June 05, 2002 5:53 PM > To: 'r-help at lists.R-project.org' > Subject: [R] par(new=T) with xyplot > > > I know I should not mix base plotting functions with > grid/lattice functions, > but I have used a "quick-and-dirty" trick of par(new=T) in > the past for > annotating a trellis-drawn graph in various versions of S-PLUS. The > sequence goes something like this: > > > windows(width = 5, height = 5, pointsize = 10) # open up the device > > > xyplot(y ~ x) > > par(new=T) > > xyplot(y2 ~ x) > > par(new=F) > > Using R 1.5.0 in Windows, I tried this for the first time > today, and the > par(new=T) setting appears to be ignored by the second xyplot > call; i.e., > the frame is cleaned and only the second printing of xyplot > appears on the > device. (If instead of the second xyplot I use a base plot > function like > plot.default, the frame is not cleaned, which I want to happen). > > Is there anything analogous to par(new=T) that I could use to > achieve this > behavior of "not cleaning the frame" with lattice commands? > Any workaround > or advice is appreciated. > > Thanks in advance, > Bill > ---------------------------------------- > Bill Pikounis, Ph.D. > Biometrics Research Department > Merck Research Laboratories > PO Box 2000, MailDrop RY70-38 > ## Please note that as of Wed 12 Jun 2002 > ## MailDrop will be RY84-16 > 126 E. Lincoln Avenue > Rahway, New Jersey 07065-0900 > USA > > v_bill_pikounis at merck.com > > Phone: 732 594 3913 > Fax: 732 594 1565 > > > > -------------------------------------------------------------- > ---------------- > Notice: This e-mail message, together with any attachments, > contains information of Merck & Co., Inc. (Whitehouse > Station, New Jersey, USA) that may be confidential, > proprietary copyrighted and/or legally privileged, and is > intended solely for the use of the individual or entity named > in this message. If you are not the intended recipient, and > have received this message in error, please immediately > return this by e-mail and then delete it. > > =============================================================> ===============> > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. > -.-.-.-.-.-.-.-.- > r-help mailing list -- Readhttp://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._ ---------------------------------------------------------------------------- -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it. ============================================================================ ------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it. ============================================================================= -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._