Hi, I wonder if anyone knows how to control color and darkness of the background grid generated by ' type = c("g", "p") ' in a lattice plot (e.g., in xyplot). The documentation does not seem to offer a way to change them. Thanks a lot! Wen
On Apr 8, 2010, at 11:07 PM, Wen Huang wrote:> Hi, > > I wonder if anyone knows how to control color and darkness of the > background grid generated by ' type = c("g", "p") ' in a lattice > plot (e.g., in xyplot). The documentation does not seem to offer a > way to change them. >I wonder. Here's what I see based on the documentation ?panel.grid # has col.line as one of 6 arguments ... so ... # with the example in ?xyplot ... # ------------- EE <- equal.count(ethanol$E, number=9, overlap=1/4) ## Constructing panel functions on the fly; prepanel xyplot(NOx ~ C | EE, data = ethanol, prepanel = function(x, y) prepanel.loess(x, y, span = 1), xlab = "Compression Ratio", ylab = "NOx (micrograms/J)", panel = function(x, y) { panel.grid(h=-1, v= 2, col.line="red", lty=3) panel.xyplot(x, y) panel.loess(x,y, span=1) }, aspect = "xy") Seems to alter "them", at least to the minimal extent of the offered explanation. -- David -- David Winsemius, MD West Hartford, CT
The default settings come from trellis.par.get("reference.line") On 9 April 2010 13:07, Wen Huang <whuang.ustc at gmail.com> wrote:> Hi, > > I wonder if anyone knows how to control color and darkness of the background > grid generated by ' type = c("g", "p") ' in a lattice plot (e.g., in > xyplot). The documentation does not seem to offer a way to change them. > > Thanks a lot! > > Wen > > ______________________________________________ > R-help at 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. >-- Felix Andrews / ??? Postdoctoral Fellow Integrated Catchment Assessment and Management (iCAM) Centre Fenner School of Environment and Society [Bldg 48a] The Australian National University Canberra ACT 0200 Australia M: +61 410 400 963 T: + 61 2 6125 4670 E: felix.andrews at anu.edu.au CRICOS Provider No. 00120C -- http://www.neurofractal.org/felix/