[R] different plot symbols in key using xyplot
ehlers at ucalgary.ca
Sun Oct 25 20:24:52 CET 2009
Stephen Kennedy wrote:
> I'm using xyplot in a very simple way---a scatter plot of several data
> sets. I'm having a problem getting auto.key to display different
> point characters.
> The following produces a plot that employes different colors, all with
> pch(1), for the different groups, with a matching key.
> xyplot(Force~Time, rawData, groups=Sample, panel = panel.superpose,
> The following produces a plot that employs different symbols (and
> colors) for the groups, but the key still uses pch(1) for all groups.
> I assume I need to set some more general option, but haven't found it
> xyplot(Force~Time, rawData, groups=Sample, pch=0:18, panel =
> panel.superpose, auto.key=list(space="right", pch=0:18))
> What I would really like is a plot with different symbols, all with
> black color. The following works for the plot, but again has no
> effect on the key.
> xyplot(Force~Time, rawData, groups=Sample, pch=0:18, col="black",
> panel = panel.superpose, auto.key=list(space="right", pch=0:18))
xyplot(Sepal.Width ~ Petal.Width, data = iris, groups = Species,
par.settings = list(superpose.symbol = list(col = 1, pch = 0:2)),
auto.key = TRUE)
> Steve Kennedy
> Stephen J. Kennedy, Ph.D.
> Contract Research & Development
> PLEASE NOTE: NEW EMAIL ADDRESS
> StephenJKennedy at myfairpoint.net
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help