Hi R users: How can I obtain an italic font only for one of the two strips in a xyplot? library(lattice) t<-rep(seq(0,10,5),4) logCFU<-c(2,2.5,3,4,4.5,1.5,2,2.5,3,3.4,2,2.5) microorg<-factor(rep(c("E. coli","L. monocytogenes"),each=6)) tratam<-factor(rep(c("t1","t2"),6)) xyplot(logCFU~t|microorg+tratam,type="p", strip=strip.custom(par.strip.text=list(fontface=c("italic","bold")))) Thank you for your help. Kenneth
On 2011-06-26 11:33, Kenneth Roy Cabrera Torres wrote:> Hi R users: > > How can I obtain an italic font only > for one of the two strips in a xyplot? > > library(lattice) > t<-rep(seq(0,10,5),4) > logCFU<-c(2,2.5,3,4,4.5,1.5,2,2.5,3,3.4,2,2.5) > microorg<-factor(rep(c("E. coli","L. monocytogenes"),each=6)) > tratam<-factor(rep(c("t1","t2"),6)) > xyplot(logCFU~t|microorg+tratam,type="p", > strip=strip.custom(par.strip.text=list(fontface=c("italic","bold"))))Is this what you have in mind: myfonts <- c(2, 4) xyplot(logCFU ~ t | microorg + tratam, strip = function(..., which.given, par.strip.text) strip.default(..., which.given = which.given, par.strip.text = list( font = myfonts[which.given]))) Peter Ehlers> > Thank you for your help. > > Kenneth > > ______________________________________________ > 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.
Kenneth Roy Cabrera Torres
2011-Jun-26 21:44 UTC
[R] [SOLVED] Only one strip with italic font.
Thank you very much! That was exactly what I need! The answer was not obvious as I thought. El dom, 26-06-2011 a las 14:36 -0700, Peter Ehlers escribi?:> On 2011-06-26 11:33, Kenneth Roy Cabrera Torres wrote: > > Hi R users: > > > > How can I obtain an italic font only > > for one of the two strips in a xyplot? > > > > library(lattice) > > t<-rep(seq(0,10,5),4) > > logCFU<-c(2,2.5,3,4,4.5,1.5,2,2.5,3,3.4,2,2.5) > > microorg<-factor(rep(c("E. coli","L. monocytogenes"),each=6)) > > tratam<-factor(rep(c("t1","t2"),6)) > > xyplot(logCFU~t|microorg+tratam,type="p", > > strip=strip.custom(par.strip.text=list(fontface=c("italic","bold")))) > > Is this what you have in mind: > > myfonts <- c(2, 4) > xyplot(logCFU ~ t | microorg + tratam, > strip = function(..., which.given, par.strip.text) > strip.default(..., > which.given = which.given, > par.strip.text = list( > font = myfonts[which.given]))) > > Peter Ehlers > > > > > Thank you for your help. > > > > Kenneth > > > > ______________________________________________ > > 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. >