Skip to content
Prev 170471 / 398503 Next

help change auto.key colors in xyplot

On Fri, Feb 13, 2009 at 1:22 PM, Dieter Menne
<dieter.menne at menne-biomed.de> wrote:
And here is a ggplot2 solution ;)

df <- data.frame(
  x = rep(d[[2]], 2),
  y = c(d[[1]], d[[3]]),
  group = rep(c("Group 1", "Group 2"), each = 3)
)

ggplot(df, aes(x, y, group = group)) +
  geom_point(aes(colour = group), size = 3) +
  geom_line(aes(colour = group), size = 1.5) +
  geom_text(aes(label = y, y = y + 0.02), vjust = 0, size = 4)

The legends are pretty good at figuring out exactly what should be
displayed, based on what you've used in the graphic.

Hadley