Skip to content
Prev 144400 / 398500 Next

lattice: left-aligned text in strips?

On May 14, 2008, at 3:47 AM, RINNER Heinrich wrote:

            
Here's a way to do it, shamelessly stealing the main idea from:  
http://dsarkar.fhcrc.org/lattice/book/figures.html? 
chapter=10;figure=10_24

Mainly you just have to write your own strip function.

xyplot(Petal.Length~Petal.Width|Species, iris, strip=function 
(which.given,which.panel, factor.levels,...) {
   panel.rect(0, 0, 1, 1, col = trellis.par.get("strip.background") 
$col[which.given], border = 1)
   panel.text(x = 0, y = 0.5, pos = 4, lab = factor.levels[which.panel 
[which.given]])
} )

Better yet, you should probably write a more generic strip function  
that does what you want.

I would however consider using ?abbreviate for what you want to do  
instead.
Haris Skiadas
Department of Mathematics and Computer Science
Hanover College