[R] Identify groups by character point in xyplot legend

Deepayan Sarkar deepayan.sarkar at gmail.com
Wed Jun 24 03:00:20 CEST 2009


On Tue, Jun 23, 2009 at 1:38 PM, nmset<nmset at netcourrier.com> wrote:
>
> http://www.nabble.com/file/p24173983/groups.csv groups.csv
> http://www.nabble.com/file/p24173983/groups.r groups.r
>
> Hello,
>
> Points of an xyplot can be identified to a particular group according to
> 'sunflowers', a different one per group. However, this distinction does not
> appear in the legend generated by auto.key, all groups are expressed as a
> point or line, of different colours, but without 'sunflowers'. The
> distinction between groups is readily made when there are few groups, but
> not when there are many.
>
> Is there a way to differentiate groups in the legend by the corresponding
> 'sunflowers' in the plot region ?
>
> The attached files would expose the problem graphically.

I'm not sure what your question is, but if it's that the plotting
characters in the legend does not match the ones in the plot, the
simplest way to fix that is

xyplot(LOAD_1 ~ mins, data=upt, type=c('g','p','r'), scales=lst,
groups=hr, auto.key=list(space = "left"),
       par.settings = simpleTheme(pch=1:2))

-Deepayan




More information about the R-help mailing list