There have been posts in the past regarding similar questions, but many of them looked dated. I am using xyplot to show variability within my replicates, and so far so good, but I would like to refine the plot. I've used the code below to graph my response variable against year (coded as a factor with three levels 2009, 2010, 2011). Each replicate is in a different panel (|field). My group variable is a factor (Management) with three levels. I would like to define the symbol and color of each factor level. xyplot(Hill.s.diversity ~ Year| Field, group=Management, layout=c(2,3), main="Hills evenness by Management Block, June 2009-2011", ylab="Hills evenness", data=summer_pr_avg) -- View this message in context: http://r.789695.n4.nabble.com/identifying-groups-in-xyplot-tp3922985p3922985.html Sent from the R help mailing list archive at Nabble.com.
There's a great tutorial online that helped me out a lot - Lattice and Other Graphics in R, by J H Maindonald at the Centre for Mathematics and Its Applications at Australian National University. http://maths.anu.edu.au/~johnm/r-book/2edn/xtras/rgraphics.pdf I gave my lattice object a name, and then I was able to superimpose changes via the update fcn. I'm sure there are many other ways to do this, but this was very simple to follow and delivered results quickly. Fieldplots = xyplot(Hill.s.diversity ~ Year| Field, group=Management, layout=c(2,3), data=summer_pr_avg, auto.key=TRUE) Fieldplots update ( Fieldplots, main="Hill's evenness by Field, June 09-11", par.settings = simpleTheme (pch=c(1 ,3 ,4))) -- View this message in context: http://r.789695.n4.nabble.com/identifying-groups-in-xyplot-tp3922985p3923338.html Sent from the R help mailing list archive at Nabble.com.
Hi, Just include pch=c(1,2,3), col=c('red','blue','yellow') or your choices in xyplot Weidong Gu On Thu, Oct 20, 2011 at 2:15 PM, wisc_maier <cmaier2 at wisc.edu> wrote:> There have been posts in the past regarding similar questions, but many of > them looked dated. I am using xyplot to show variability within my > replicates, and so far so good, but I would like to refine the plot. I've > used the code below to graph my response variable against year (coded as a > factor with three levels 2009, 2010, 2011). Each replicate is in a different > panel (|field). My group variable is a factor (Management) with three > levels. I would like to define the symbol and color of each factor level. > > xyplot(Hill.s.diversity ~ Year| Field, group=Management, > layout=c(2,3), > main="Hills evenness by Management Block, June 2009-2011", > ylab="Hills evenness", > data=summer_pr_avg) > > -- > View this message in context: http://r.789695.n4.nabble.com/identifying-groups-in-xyplot-tp3922985p3922985.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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. >