[R-sig-eco] Problem with strip names in bwplot (lattice)
Augusto Ribas
ribas.aca at gmail.com
Mon Nov 9 20:34:10 CET 2015
Hello, i'm haveing 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)
library(lattice)
#species names need to be in italic, so i wrote them like this
bwplot(resposta~preditor1|preditor2,
strip = strip.custom(factor.levels = c(
expression(italic("P. paradoxa")),
expression(italic("H. raniceps")),
expression(italic("P. azurea")))
)
)
#but i wanted a second line, with more information, but no in italic, so in
the foruns, i saw a
#solution useing atop from expression function
bwplot(resposta~preditor1|preditor2,
strip = strip.custom(factor.levels = c(
expression(atop(italic("P. paradoxa"),"side
information")),
expression(atop(italic("H. raniceps"),"side
information")),
expression(atop(italic("P. azurea"),"side
information")))
)
)
But the text get out of the strip, is there a way to increase the strip
size, to fit all the text, or maybe another solution to put 2 lines of text
in each strip, keeping the species name in italic?
--
Grato
Augusto C. A. Ribas
Site Pessoal: http://recologia.com.br/ <http://augustoribas.heliohost.org>
Github: https://github.com/Squiercg
Lattes: http://lattes.cnpq.br/7355685961127056
[[alternative HTML version deleted]]
More information about the R-sig-ecology
mailing list