On 11/12/2013 09:52 AM, Mª Teresa Martinez Soriano wrote:
normal<-sort(rnorm(1000)) cauchy<-sort(rcauchy(1000)) t3<-sort(rt(1000,3)) t10<-sort(rt(1000, 10)) col<-c("green","blue","orange","purple") v<-list(normal,cauchy,t3,t10) names(v)<-c("Normal", "Cauchy", "T-stud 3 df", "T-stud 10 df") par(mfrow=c(1,2)) plot(density(normal),col=col[[1]],main="Funciones de densidad") for ( i in 2:4) { lines(density(v[[i]]),col=col[[i]],lty=i+2) } legend(x=-4,y=0.3,names(v),col=col,cex=0.6)
Hi Tere, Try this: legend(x=-2,y=0.04,names(v),col=col,cex=0.6,lty=c(1,4:6)) Jim ______________________________________________ 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.