Re: [R] placing rectangle behind plot

From: Greg Snow <Greg.Snow_at_intermountainmail.org>
Date: Tue 01 Aug 2006 - 00:22:10 EST

One thing you could try (probably as last resort, if someone comes up with a better idea, use that) is to plot to an xfig device, then use xfig (or jfig) to move the rectangle to the back, then convert it to whatever final graphics format you want.

-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch on behalf of Gabor Grothendieck Sent: Sat 7/29/2006 3:20 PM
To: RHelp
Subject: [R] placing rectangle behind plot  

I am trying to create a lattice plot and would like to later, i.e. after the plot is drawn, add a grey rectangle behind a portion of it. The following works except that the rectrangle is on top of and obscures a portion of the chart. I also tried adding col = "transparent" to the gpar list but that did not help -- I am on windows and perhaps the windows device does not support transparency? At any rate, how can I place the rectangle behind the plotted points without drawing the rectangle first?

library(lattice)
library(grid)
trellis.unfocus()
x <- 1:10
xyplot(x ~ x | gl(2,1), layout = 1:2)
trellis.focus("panel", 1, 1)
grid.rect(w = .5, gp = gpar(fill = "light grey")) trellis.unfocus()



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 and provide commented, minimal, self-contained, reproducible code.

        [[alternative HTML version deleted]]



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 and provide commented, minimal, self-contained, reproducible code. Received on Tue Aug 01 05:48:20 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 Tue 01 Aug 2006 - 08:18:17 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.