Hi, I seem to be unable to get a mixed legend that has lines *or* polygons (not both). For example:
ppi <- seq(0,2*pi,length.out=21)[-21] frame() plot.window(ylim=c(-5,5),xlim=c(-5,5),asp=1) polygon(cos(ppi)*4+rnorm(20,sd=.2),sin(ppi)*4+rnorm(20,sd=.2), col="green",border=FALSE) polygon(cos(ppi)*2+rnorm(20,sd=.1),sin(ppi)*2+rnorm(20,sd=.1), col="blue",border=FALSE) abline(0,2,col="red") legend("topleft",legend=c("out","in","line"),bty="n", fill=c("green","blue",NA),col=c(NA,NA,"red"), lwd=c(NA,NA,1)) I'm really guessing the behaviour in the legend() call, by setting fill to NA for the item, etc. I also tried fill=c("green","blue",FALSE), but that didn't go over too well either. I also tried adding "merge=TRUE", but that just puts the line into the box. I also tried using box.lwd=c(1,1,0), but that also did not work Is there either a way to do this or a clean workaround? Thanks in advance. +mt ______________________________________________ R-help@stat.math.ethz.ch 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.