Great! Thanks to both Paul and Deepayan for these efficient approaches! -Dan
Deepayan Sarkar wrote: > On 11/6/06, Paul Murrell <[EMAIL PROTECTED]> wrote: >> Hi >> >> >> Deepayan Sarkar wrote: >> > On 11/6/06, Daniel E. Bunker <[EMAIL PROTECTED]> wrote: >> >> Dear All, >> >> >> >> I am hoping to implement a barchart using trellis graphics where all >> >> elements have a line width of 2. >> >> >> >> Using trellis.par.set(), I am able to make most elements lwd=2, but >> not >> >> all. In particular, the top of the box (above the upper most >> strip) and >> >> the left y-axis remain one point. >> > >> > Actually, those are lwd=2 too, but half of the lines are getting >> > clipped (this should happen on the right/bottom too, and does in PDF >> > output, for example. Not sure why it's not as clear on screen >> > devices). Anyway, you can add >> > >> > trellis.par.set("clip", list(panel = "off", strip = "off")) >> > >> > and see if that helps you. >> >> >> And instead of all those 'lwd=2' settings, you could just use 'lex=2', >> as in ... >> >> >> library(grid) >> library(lattice) >> >> windows(width=6, height=4, record=TRUE) >> >> trellis.par.set("clip", list(panel = "off", strip = "off")) >> >> pushViewport(viewport(gp=gpar(lex=2))) >> print(barchart(yield ~ variety | site, >> data = barley, groups = year, >> layout = c(1, 6), >> ylab = "Barley Yield (bushels/acre)", >> scales = list(x = list(abbreviate = TRUE, >> minlength = 5))), >> newpage=FALSE) >> upViewport() > > Cool! There's also the "grid.pars" trellis.par now for things like > this, so you could also do > > > trellis.par.set("clip", list(panel = "off", strip = "off")) > trellis.par.set("grid.pars", list(lex = 2)) > > barchart(yield ~ variety | site, > data = barley, groups = year, > layout = c(1, 6), > ylab = "Barley Yield (bushels/acre)", > scales = list(x = list(abbreviate = TRUE, > minlength = 5))) > > > -Deepayan -- Daniel E. Bunker BioMERGE Associate Director Post-Doctoral Research Scientist Columbia University Department of Ecology, Evolution and Environmental Biology 1200 Amsterdam Avenue New York, NY 10027-5557 deb37ATcolumbiaDOTedu 212-851-1888 phone 212-854-8188 fax ______________________________________________ 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.