Hello. I am sorry for posting a (seemingly) simple question, but I have just spent 2 hours trying to find the answer, without success. I want to make a histogram with conditioning on a factor, using Trellis graphics. However, I do not want any colours (only black and white) either in the histograms or in the strip. There must be some simple argument but I can’t find it. Here is my code so far:> histogram(~GRC.SLA|as.factor(species.type),data=group.means,+ strip=function(...) + strip.default(...,style=1,factor.levels=c("Conifers","Trees","Herbs","Mo nocots"))) As a default, this produces the bars in a pale blue and the strip in orange-yellow. Thanks. Bill Shipley Subject Matter Editor, Ecology North American Editor, Annals of Botany Département de biologie, Université de Sherbrooke, Sherbrooke (Québec) J1K 2R1 CANADA Bill.Shipley@USherbrooke.ca <http://callisto.si.usherb.ca:8080/bshipley/> http://callisto.si.usherb.ca:8080/bshipley/ [[alternative HTML version deleted]]
Does this help? mydata <- data.frame(OPTIMISM = c(29,35,26,22,30,37,29,32,25,35,38,33,41,28,40), PARENTS = rep(c("Both Deceased", "One Deceased", "Both Alive"), c(4,5,6))) library(lattice) trellis.device(width=7, height=5, new = FALSE, col = FALSE, bg = "white") histogram(~ OPTIMISM | PARENTS, data=mydata) Bill Shipley wrote:> Hello. I am sorry for posting a (seemingly) simple question, but I have > just spent 2 hours trying to find the answer, without success. I want > to make a histogram with conditioning on a factor, using Trellis > graphics. However, I do not want any colours (only black and white) > either in the histograms or in the strip. There must be some simple > argument but I can??t find it. Here is my code so far: > >>histogram(~GRC.SLA|as.factor(species.type),data=group.means, > > + strip=function(...) > > + > strip.default(...,style=1,factor.levels=c("Conifers","Trees","Herbs","Mo > nocots"))) > > As a default, this produces the bars in a pale blue and the strip in > orange-yellow.-- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 452-1424 (M, W, F) fax: (917) 438-0894
On Friday 01 October 2004 09:16, Bill Shipley wrote:> Hello. I am sorry for posting a (seemingly) simple question, but I > have just spent 2 hours trying to find the answer, without success. > I want to make a histogram with conditioning on a factor, using > Trellis graphics. However, I do not want any colours (only black and > white) either in the histograms or in the strip. There must be some > simpletrellis.device(color = FALSE) ## assuming you want the default device. ## See ?trellis.device for more options histogram(<...>) Deepayan
Dear bill, Try opening the Trellis graphics device with trellis.device(color=FALSE). I hope this helps, John> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Bill Shipley > Sent: Friday, October 01, 2004 9:17 AM > To: R help list > Subject: [R] controlling colour in Trellis histogram > > Hello. I am sorry for posting a (seemingly) simple question, > but I have just spent 2 hours trying to find the answer, > without success. I want to make a histogram with > conditioning on a factor, using Trellis graphics. However, I > do not want any colours (only black and white) either in the > histograms or in the strip. There must be some simple > argument but I can??t find it. Here is my code so far: > > > > > histogram(~GRC.SLA|as.factor(species.type),data=group.means, > > + strip=function(...) > > + > strip.default(...,style=1,factor.levels=c("Conifers","Trees","Herbs","Mo> nocots"))) > > > > As a default, this produces the bars in a pale blue and the > strip in orange-yellow. > > > > Thanks. > > > > Bill Shipley > > Subject Matter Editor, Ecology > > North American Editor, Annals of Botany > > D??partement de biologie, Universit?? de Sherbrooke, > > Sherbrooke (Qu??bec) J1K 2R1 CANADA > > Bill.Shipley at USherbrooke.ca > > <http://callisto.si.usherb.ca:8080/bshipley/> > http://callisto.si.usherb.ca:8080/bshipley/ > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html