I still can't tell exactly what you want, but maybe something like this? > legend(30,0.08, c("Normal density","Kernel > density"),col=c("red","blue"),lty=1:1,lwd=1:1,bty="n") > legend(30,0.06, c(paste("Mean =",round(mean(CDR3),1)),paste("Median > =",median(CDR3))),col=c("red","black"),pch=19:19,bty="n") > > I tried the code below to create one legend, but I failed: > legend(x3,y3, > c("Normal density","Kernel density","paste("Mean > =",round(mean(CDR3),1)","paste("Median > =",median(CDR3))"),c(lty=1,lty=1,pch=19,pch=19),col=c("red","blue","red","black"),bty="n")
legend(x3,y3, c("Normal density","Kernel density","paste("Mean =",round(mean(CDR3),1)","paste("Median =",median(CDR3))"), lty=c(1, 1, NA, NA), pch=c(NA, NA, 19, 19), col=c("red","blue","red","black"), bty="n") -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ 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.