I'm having difficulties to write correctly a strip name in a lattice plot. Here is a data example:
resposta<-rnorm(90)
preditor1<-rep(rep(c("a","b"),each=15),3)
preditor2<-rep(c("sp1","sp2","sp3"),each=30)
And I'm doing the following plot:
library(lattice)
bwplot(resposta~preditor1|preditor2,layout=c(3,1),
strip=strip.custom(
factor.levels=c(
expression(atop(italic("P. paradoxa"),"outra info")),
expression(atop(italic("H. raniceps"),"outra info")),
expression(atop(italic("P. azurea"),"outra info")))
),
par.settings=list(layout.heights=list(strip=2.5))
)
My question is, are there a way to get a smaller space between the species name and "outra info". This problem started because, as the title are species names, they need to be in italic, but I also need to add some extra information on the title, and this should not be in italic. I saw on Google the possibility to use atop
inside an expression
to get 2 lines of text, but I get a too big space between the species name and the next line. I would like them to be closer together, but I don't know if it is possible, and if so, how to do it.
Does anyone know how to skip lines in the strip name, keeping the expression for the italics but not make too much space between names? It's not so bad on the plot, but when I use tiff()
to save to a image with a greater size, the strip names are missing some parts, basically due to the distance between the lines, I think.