Hi, Could you not simplify your a and b plots into one like
xyplot(NDVI_P10 + AVG_NDVI_P10 ~ dek_num | Year, data=data, lty = 3:2, col = c("darkgrey", "black"), ..., [etc] auto.key = list(lines = TRUE, points = FALSE)) Otherwise please provide a commented, minimal, self-contained, reproducible example. Regards Felix On 15 April 2011 18:25, Francesco Nutini <nutini.france...@gmail.com> wrote: > > > > > > > > > > Sorry, my previous mail was incomplete. > > I mean, one of my xyplot is build with the command "doubleYScale" (in order > to overlap two line with different Y-axis). > But "doubleYScale" doesn't run with the nice command that you have > suggested: > > first plot: > > > > > a<-xyplot(NDVI_P10~dek_num > | Year, type="a", data=data, xlim=c(1,37), ylim=c(0.1,0.8), as.table = TRUE, > layout = > c(13,1), aspect = 2, col="darkgrey", > col.axis="black", lwd=3, grid=T, par.settings = > list(strip.background = list(col = c("gray90")))) > second plot: > > > b<-xyplot(AVG_NDVI_P10~dek_num | Year, > type="a", data=data, xlim=c(1,37), > ylim=c(0.1,0.8), as.table = TRUE, layout = c(13,1), aspect = 2, col="black", > col.axis="black", lwd=2) > overlap first and second: > > > double<- update(doubleYScale(a, > b, add.ylab2 = TRUE), par.settings = simpleTheme(col = > c("black","black"))) > third plot: > > > z<- xyplot(z_NDVI_P10 > ~dek_num | Year, type="h", data=data, xlim=c(1,37), ylim=c(-2.5,2.5), > as.table = TRUE, layout = > c(13,1), aspect = 2, col="black", > col.axis="black", lwd=3, grid=T, par.settings = > list(strip.background = list(col = c("gray90")))) > enclose (?c.trellis): > > > > > c( z,double, x.same = TRUE, y.same = T, layout = c(13,2)) > > Maybe there is no solution but, anyway, thanks for help! > francesco > > > > > > > > > From: nutini.france...@gmail.com > To: baptiste.aug...@googlemail.com > CC: r-help@r-project.org > Subject: RE: [R] how to enclose two xyplot > Date: Thu, 14 Apr 2011 15:31:12 +0000 > > > > > > > > > ok ?c.trellis works well. > But I still have a problem. > > One of my plot is a combination of two xyplot on different scales: > > > > a<-xyplot(NDVI_P10~dek_num > | Year, type="a", data=data, xlim=c(1,37), ylim=c(0.1,0.8), as.table = TRUE, > layout = > c(13,1), aspect = 2, col="darkgrey", > col.axis="black", lwd=3, grid=T, par.settings = > list(strip.background = list(col = c("gray90")))) > > b<-xyplot(AVG_NDVI_P10~dek_num | Year, > type="a", data=data, xlim=c(1,37), > ylim=c(0.1,0.8), as.table = TRUE, layout = c(13,1), aspect = 2, col="black", > col.axis="black", lwd=2) > > update(doubleYScale(a, b, add.ylab2 = > TRUE), par.settings = simpleTheme(col = > c("black","black"))) > > > > > > From: nutini.france...@gmail.com > To: baptiste.aug...@googlemail.com > CC: r-help@r-project.org > Subject: RE: [R] FW: [r] how to enclose two xyplot > Date: Thu, 14 Apr 2011 07:46:31 +0000 > > > > > > > > > Did you mean this? > http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=latticeExtra:c.trellis > > In fact I'm already using latticeExtra package because my xyplot is little > bit complicated... > So, I'm tring, thanks fro tricks baptiste! > > Francesco > > >> Date: Thu, 14 Apr 2011 08:52:45 +1200 >> Subject: Re: [R] FW: [r] how to enclose two xyplot >> From: baptiste.aug...@googlemail.com >> To: nutini.france...@gmail.com >> CC: r-help@r-project.org >> >> Hi, >> >> Have you tried ?c.trellis in the latticeExtra package? >> >> HTH, >> >> baptiste >> >> On 13 April 2011 23:36, Francesco Nutini <nutini.france...@gmail.com> wrote: >> > >> > Dear R-users, >> > >> > I have to plot two xyplot, and I wish to enclose this two graphs with just >> > one headline, the same x scale, the same grid etc. >> > These parameters should tie in, in order to obtain, visually, a unique >> > graph formed by two xyplot. >> > >> > I try to give an idea: >> > >> > xyplot1: |_|_|_| >> > >> > >> > >> > xyplot2: |_|_|_| >> > >> > >> > >> > what i want: | | | | >> > >> > |_|_|_| >> > >> > >> > I tried to use the command "par", but it's doesn't work with xyplot. The >> > two plot have, by default, the same x-axis scale. >> > I know it's just a "visual solution", but it could be nice for a paper! >> > >> > Thanks a lot, >> > >> > Francesco Nutini >> > PhD student >> > >> > >> > >> > >> > >> > [[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. >> > > > [[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. > -- Felix Andrews / 安福立 http://www.neurofractal.org/felix/ ______________________________________________ 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.