Deepayan Sarkar <deepayan.sarkar <at> gmail.com> writes: > > One other thing that has so far eluded me is how to specify two > > different kinds of symbols on a single column. The key above shows > > > > text line text rectangle > > > > but I would really like to get > > > > text line > > text rectangle > > > > but this did not seem possible to me. Am I wrong? > > Not possible with draw.key(), but legends can be arbitrary grobs, so > you could construct a suitable one.
I would have guessed that columns=2 would work, but you are right, it given an error message (Not enough rows for columns). Why? Dieter xyplot(1~1, panel = function(...) { require(grid) panel.xyplot(...) draw.key(list(text=list(lab='catch'), columns=2, lines=list(lwd=c(2)), text=list(lab='landings'), rectangles=list(col=rgb(0.1, 0.1, 0, 0.1))), draw = TRUE, vp = viewport(x = unit(0.75, "npc"), y = unit(0.9, "npc"))) }) ______________________________________________ R-help@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.