Examples of the "legend" command in Splus. EXAMPLE 1: d<-b+rnorm(100,0,1) plot(b,d) abline(lsfit(b,d),lty=2) abline(0,1,lty=1) legend(1.5,-1.5,c("regression line","x=y line"),lty=c(2,1)) EXAMPLE 2: Note that the histogram here is scaled as a probability density via the prob=T option in the hist command. a<-seq(-3,3,by=.1) b<-rnorm(100) hist(scale(b),prob=T,ylim=c(0,.4),xlim=c(-4,4),ylab="density") lines(a,dnorm(a)) lines(density(scale(b),width=2),lty=2) legend(2,.35,c("normal density","estimated density"),lty=1:2) title("Figure 2") OTHER EXAMPLES: For more examples, see the bottom of the help file on the legend command in Splus.