Skip to content
Prev 305159 / 398506 Next

bwplot(): Can Panel Heading Span Two Lines? [RESOLVED]

On Sep 10, 2012, at 1:48 PM, Bert Gunter wrote:

            
Bert;

  I had imagined that the factor level character strings could be automagically separated by substituting '\n' at each space or dash or wahtever:

strip.new <- function( which.given, which.panel, factor.levels, ...){ 
                 panel.text( x=0.5,y=1.5, lab=gsub("\\ ", "\n", factor.levels) )}

# Need to tweak the line height

xyplot(y~x|f, strip=strip.new)

Your approach of changing the levels to be pre-split with '\n's may be more straightforward.