In making grid graphs, one can make the background semi-transparent
with a line like

grid.rect(gp=gpar(lty=0, fill=rgb(.5, .5, 0,. 25)))

and then make the area where points and lines are plotted white with lines like

pushViewport(plotViewport(c(5,4,3,1)))
pushViewport(dataViewport(year, m, name="plotRegion"))
grid.rect(gp=gpar(fill="white"))

(The area where the labels, title, legend, etc. are remains semi-transparent.)

I need to use the features of lattice for some graphs but want to keep
the same color theme. In lattice, the background can be changed with
the lines below, but it makes the entire graph this color.

    bsettings=trellis.par.get("background")
    bsettings$col=rgb(.5, .5, 0, .25)
    trellis.par.set("background", bsettings)

How do I now change just the plot region back to white?

Thanks.

______________________________________________
R-help@r-project.org 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.

Reply via email to