[R] Lattice xyplot: Fill Legend Points

Rich Shepard rshepard at appl-ecosys.com
Thu Oct 17 20:37:56 CEST 2013


On Thu, 17 Oct 2013, Richard M. Heiberger wrote:

> I always get lost in simpleKey.

   As this is my first use of it I take what's offered by those more
experienced than I.

> The approach of directly modifying the trellis object usually works.
> tmp <- xyplot(pct.quant ~ sampdate, data = ffg.st, groups = func_feed_grp, type =
> + 'p', pch = 19, key = simpleKey(text = levels(ffg.st$func_feed_grp), space =
> + 'right', points = T, lines = F),par.settings = list(superpose.points =
> + list(col = rainbow(7)), superpose.lines = list(col = rainbow(7))), main =
> + 'Functional Feeding Groups (Individuals)', xlab = 'Year', ylab = 'Proportion
> + of Individuals')
>> tmp
>> str(tmp)
>> tmp$legend$right$args$key$points$pch
> [1] 1 1 1 1 1 1 1
>> tmp$legend$right$args$key$points$pch[] <- 19
>> tmp$legend$right$args$key$points$pch
> [1] 19 19 19 19 19 19 19

   OK. More steps but it will get the plots where they need to be.

Many thanks,

Rich

-- 
Richard B. Shepard, Ph.D.          |      Have knowledge, will travel.
Applied Ecosystem Services, Inc.   |
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863



More information about the R-help mailing list