Richard, Thanks for your email. I am not looking for that kind of plot as you had suggested. I would like to see overlaid boxplots. Deepayan had earlier shown the method of overlay of boxplots (using panel.groups=panel.bwplot)...
I have seen in some packages like ggplot2, where the overlapped plots are automatically shown as a mix of overlapping colors, and was wondering if similar features can be implemented in lattice package... **Reproducing the earlier posted code for convenience..** tmp <- data.frame( y=rnorm(100), category=rep(factor(letters[1: 5]),each=20), level=rep(factor(0:1), length=100)) barchart(y~factor(category), groups=level, data=tmp,jitter.x=F, panel=function(...){ panel.superpose( ...) panel.superpose(panel.groups=panel.bwplot, alpha=c(0.5,0.5), varwidth=T,notch=T, col=c("red","blue"), fill=c("pink","lightblue"),pch=16, par.settings=list(box.umbrella=list(col=c("red","blue"),box.dot=list(col=c("red","blue")))),...) panel.superpose(panel.groups=panel.loess,lwd=2,col.line=c("red","blue"),alpha=0.2,lty=1,...) panel.abline(h=0,col="black",lty=2)}, xlab="time bin (week)", auto.key=list(space="right",text=c("A","H"),points=T)) Thanks, Santosh On Thu, Apr 29, 2010 at 1:58 PM, RICHARD M. HEIBERGER <r...@temple.edu>wrote: > Santosh, > > continuing with your example, I recommend several functions in the HH > package. > > ## install.packages("HH") ## needed once, if you don't already have it > > require(HH) > > tmp <- data.frame(y=rnorm(100), > category=rep(factor(letters[1:5]), each=20), > level=rep(factor(0:1), length=100)) > bwplot(y ~ interaction(level, category), data=tmp, col=c("red","blue"), > panel=panel.bwplot.intermediate.hh) > tmp$lv <- with(tmp, interaction(level, category)) > position(tmp$lv) <- outer(c(-.3,.3), seq(1.5, 9.5, 2), `+`) > bwplot(y ~ lv, data=tmp, col=c("red","blue"), > panel=panel.bwplot.intermediate.hh, > scales=list(x=list(at=seq(1.5, 9.5, 2), labels=letters[1:5]))) > > Rich > > [[alternative HTML version deleted]] ______________________________________________ R-help@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.