Re: [R] Legends in xyplot

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Wed 18 Jan 2006 - 03:46:59 EST

On 1/17/06, Ravi Varadhan <rvaradhan@jhmi.edu> wrote:
> Hi Uwe,
>
> I am aware of the "legend" option in xyplot, but I can't figure out how to
> make it work. In particular, I do not understand how to use "legend" along
> with the "key" argument. For my example, I would like to have a legend box
> inside the plotting frame to indicate the 3 different smoothed curves.
> Can someone give me a simple example or show how to do this for my example?

Here's a modified version of an example in demo(lattice):

xyplot(Petal.Length ~ Petal.Width, data = iris,

       groups = Species,
       type = c("p", "smooth"), span=.75,
       auto.key =
       list(title = "Iris Data",
            x = .15, y=.85, corner = c(0,1),
            border = TRUE, lines = TRUE))

-Deepayan



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jan 18 04:28:03 2006

This archive was generated by hypermail 2.1.8 : Wed 18 Jan 2006 - 06:10:37 EST