On Fri, Jan 21, 2011 at 8:22 PM, Fabrice Tourre <fabrice.c...@gmail.com> wrote: > Hi list, > I want to plot two plot in the same figure. I set par(new=TRUE). But > it does not work. > > library(lattice) > myPanel <- function(x,...) > { > panel.histogram(x,alpha=0.4,...) > ltext(0.4,1.5,paste("Mean=","0.05",digit=2)),cex=0.8) > ltext(0.8,1.5,paste("s.d.=","0.06",digit=2)),cex=0.8) > } > histogram(sh2, > type="percent",panel=myPanel,breaks=seq(0,1,by=0.01),ylim=c(0,5),col=rgb(0.1,0.1,0.8,0.5)) > > par(new=TRUE) #### Here is does not work. Warning message: In par(new > = TRUE) : calling par(new=TRUE) with no plot > > histogram(sh2, > type="percent",panel=myPanel,breaks=seq(0,1,by=0.01),ylim=c(0,5)) > > I want to the two hist in the same map. How can I set it in lattice?
See ?print.trellis for an overview of your options. -Deepayan ______________________________________________ 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.