Perez Martin, Agustin wrote: > DeaR UseRs: > > I want to put a legend in my plot. In the first line of the legend I want > to put a box filled but in the second one I would like to put a lty=2 > > Of course it must appear with different colors. > I think I wrote this function about a year ago for someone, but I couldn't find it anywhere. Here it is again.
Jim
add.legend.bars<-function(legend.info,whichbars,col,border="black") { nelements<-length(legend.info$text$y) left<-rep(legend.info$rect$left+ 0.1*(legend.info$text$x[1]-legend.info$rect$left),nelements) right<-rep(legend.info$rect$left+ 0.8*(legend.info$text$x[1]-legend.info$rect$left),nelements) top<-legend.info$text$y+(legend.info$text$y[1]-legend.info$text$y[2])/3 bottom<-top-(legend.info$text$y[1]-legend.info$text$y[2])/1.5 rect(left[whichbars],bottom[whichbars], right[whichbars],top[whichbars], col=col,border=border) }
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html