You can get the legend outside the plot region by 1. First changing the clipping region via par(xpd = TRUE) ; (or xpd=NA). see ?par
2. Specifying x and y coodinates for legend placement outside the limits of the plot region. This allows you to include a legend without adding a bunch of useless whitespace to the plot region; or to add a grid to the plot without interfering with the legend. Bert Gunter Genentech Nonclinical Statistics -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nguyen Dinh Nguyen Sent: Monday, August 13, 2007 3:42 PM To: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Subject: [R] Legend on graph Hi Akki, Then you may need to increase y-axis scale by ylim=c(min,max) Cheers Nguyen On 8/12/07, akki <[EMAIL PROTECTED]> wrote: > Hi, > I have a problem when I want to put a legend on the graph. > I do: > > legend("topright", names(o), cex=0.9, col=plot_colors,lty=1:5, bty="n") > > but the legend is writen into the graph (graphs' top but into the graph), > because I have values on this position. How can I write the legend on top > the graph without the legend writes on graph's values. > > Thanks. ______________________________________________ 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.