[R] Centering multi-line strip text in lattice

From: Mike Lawrence <Mike.Lawrence_at_dal.ca>
Date: Tue, 10 Mar 2009 20:48:51 -0300


I'm having trouble centering multi-line strip text in lattice. As the code below demonstrates bounding box of the text is centered within the strip, but the first line isn't centered in relation to the longer second line. The "adj" argument to par.strip.text doesn't seem to do much. Suggestions?

a=data.frame(

	x=rep(1:10,2)

,y=rep(1:10,2)
,z=rep(c('First Line\nLonger Second Line (1)','First Line\nLonger
Second Line (2)'),each=10)
)

xyplot(

	y~x|z

,data=a
,par.strip.text = list(cex = .75, lineheight=1, lines = 2, adj=.5),
)
-- 
Mike Lawrence
Graduate Student
Department of Psychology
Dalhousie University

Looking to arrange a meeting? Check my public calendar:
http://tinyurl.com/mikes-public-calendar

~ Certainty is folly... I think. ~

______________________________________________
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.
Received on Tue 10 Mar 2009 - 22:51:51 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 12 Mar 2009 - 01:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive