[R] xyplot key issue - line colors

Karin Lagesen karinlag at studmed.uio.no
Tue Aug 5 10:53:24 CEST 2008



I have a problem regarding the colors assigned to the lines in the key
to an xy plot. I specify the plot like this:

xyplot(numbers~sqrt(breaks)|moltype+disttype, groups = type, data = alldata,
      layout = c(3,2), type = "l" , lwd = 2, col = c("gray", "skyblue"), 
      key = simpleKey(levels(alldata$type), points = FALSE, lines = TRUE, 
      columns = 2, lwd = 2, col = c("gray", "skyblue")))

However, the lines in the key (the lines that indicates which line is
which) are still blue and magenta, and not gray and skyblue. I have
seen something about superposing lines on top of this somehow, but I
couldn't figure out how to do it.

Thanks!

Karin
-- 
Karin Lagesen, PhD student
karin.lagesen at medisin.uio.no
http://folk.uio.no/karinlag



More information about the R-help mailing list