Skip to content
Prev 354030 / 398506 Next

modify strip labels with given text using lattice package

On Aug 31, 2015, at 1:17 PM, Luigi Marongiu wrote:

            
Look at ?barchart in the section on arguments to strip and then at ?strip.default for how to use `strip.custom`. If you needed finer control there are functions that return the panel, but this request did not require using it:

barchart(
   test ~ count|assay,
   df,
   groups = res,
   stack = TRUE,
   main = "Comparison of test results",
   xlab = "Count",
   col = c("yellow", "blue"),
   par.settings = list(
       strip.background = list(col="light grey"),
       superpose.polygon=list(col= c("yellow", "blue"))
   ),
   strip = strip.custom( factor.levels=c("molecular test","serological test") ),

   scales = list(
       alternating = FALSE
   ),
   key = list(
       space="top",
       columns=2,
       text=list(c("Negative", "Positive"), col="black"),
       rectangles=list(col=c("yellow", "blue"))
   )
)
David Winsemius
Alameda, CA, USA