Re: [R] after setting auto.key=TRUE, legend become inconsistent with the graph

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Mon, 23 Jun 2008 22:00:02 -0700

On 6/23/08, Gabor Grothendieck <ggrothendieck_at_gmail.com> wrote:
> Set the various plotting parameters in par.settings= in which
> case both the legend and the plot itself will be taken from there.
> See for example:
>
> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/90432.html
>
> where superpose.line parameters are set. Similarly you can
> set superpose.symbol parameters.

Also check out ?simpleTheme for a shortcut. The example there also shows you how to place the legend on the right.

-Deepayan

> On Mon, Jun 23, 2008 at 11:35 PM, Mark Farnell <mark.farnell@gmail.com> wrote:
> > When I use xyplot (from package lattice) to produce a multi-series graph:
> >
> > xyplot(linear+quadratic+sqrt~x, data=df, main="complexity of different
> > functions", ylab="y", col=c("red", "black", "orange"), type="b",
> > lty=c(1,2,3), pch=c(1,2,3), auto.key=TRUE)
> >
> > where I changed the default colour, line type and data point type so
> > that each series is distinguishable from each other. The graph looks
> > good except that the color and shape of data point of each series in
> > the legend still reflects the default setting of xyplot rather than
> > what I've said in the command! This renders the legend useless. So
> > what legend command (other than auto=TRUE) should I use instead to
> > solve this problem?
> >
> > Also currently the legend is above the graph and below the title,
> > which looks weird to me and I want the legend to be placed at the
> > right of the graph instead. What should I do?
> >
> > Thanks!
> >
> > Mark
> >
> > ______________________________________________
> > 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.
> >
>
> ______________________________________________
> 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.
>



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. Received on Tue 24 Jun 2008 - 05:03:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 24 Jun 2008 - 08:30:50 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive