[R] line width (all elements) in Trellis

Daniel E. Bunker deb37 at columbia.edu
Mon Nov 6 20:51:22 CET 2006


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.

Code with a barchart() example is below.  Any advice would be greatly 
appreciated.

Thanks for your time,

Dan

note: I am using R 2.4.0 on a windows platform.


windows(width=6, height=4, record=TRUE)

tpar1=trellis.par.get("add.line")
tpar1$lwd=2
trellis.par.set("add.line", tpar1)

tpar2=trellis.par.get("plot.polygon")
tpar2$lwd=2
trellis.par.set("plot.polygon", tpar2)

tpar3=trellis.par.get("plot.line")
tpar3$lwd=2
trellis.par.set("plot.line", tpar3)

tpar4=trellis.par.get("superpose.polygon")
tpar4$lwd=c(rep(2,7))
trellis.par.set("superpose.polygon", tpar4)

tpar5=trellis.par.get("superpose.line")
tpar5$lwd=c(rep(2,7))
trellis.par.set("superpose.line", tpar5)

tpar6=trellis.par.get("axis.line")
tpar6$lwd=c(rep(2,7))
trellis.par.set("axis.line", tpar6)

tpar7=trellis.par.get("box.3d")
tpar7$lwd=2
trellis.par.set("box.3d", tpar7)

tpar8=trellis.par.get("box.rectangle")
tpar8$lwd=2
trellis.par.set("box.rectangle", tpar8)

tpar9=trellis.par.get("box.umbrella")
tpar9$lwd=2
trellis.par.set("box.umbrella", tpar9)

tpar10=trellis.par.get("dot.line")
tpar10$lwd=2
trellis.par.set("dot.line", tpar10)

tpar11=trellis.par.get("strip.border")
tpar11$lwd=c(rep(2,7))
trellis.par.set("strip.border", tpar11)

tpar12=trellis.par.get("reference.line")
tpar12$lwd=c(rep(2,7))
trellis.par.set("reference.line", tpar12)


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)))

-- 
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



More information about the R-help mailing list