On Thursday 25 March 2010, Ben Bimber wrote: > I am trying to graph weight data for our colony. We a data frame with > Animal, Weight and Date. I'd like to display this data a series of simple > xyplots. We only need to display these plots together, we do not need to > make comparisons between animals. Each animal has been weighted over a > different time period, so we do not want the same range for each X axis. > > > Using the following, I can create one plot per animal: > > size <- length(unique(data$id)) > xyplot(weight ~ date | id, > data=data, > #type="o", > layout=c(1,size), > xlab="Date", > ylab="Weight" > ); > > However, they share a common X axis. Is it possible to avoid this? In > other words, I might want the first animal's plot to extend from 2008-01-01 > through 2009-05-04, while the second plot extends from 2007-02-04 through > 2010-01-01.
Hi, Be sure to see the scales argument in the manual page for xyplot(). Here is one approach to getting different scales on the x-axis: xyplot(weight ~ date | id, data=data, layout=c(1,size), xlab="Date", ylab="Weight", scales=list(x=list(relation="free")) ) I think that there is a 'space' argument to most of the lattice plotting functions, but be sure to check the manual page. Another great resource is this website: http://lmdvr.r-forge.r-project.org/figures/figures.html Cheers, Dylan > Also, can I introduce more whitespace between each plot? > > Thank you for any help. > > [[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. -- Dylan Beaudette Soil Resource Laboratory http://casoilresource.lawr.ucdavis.edu/ University of California at Davis 530.754.7341 ______________________________________________ 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.