Skip to content
Prev 59074 / 398502 Next

Legend help needed

On 15 Nov 2004 at 12:11, Adaikalavan Ramasamy wrote:

            
to
col=i:n)

Thanks this got me going on the right track. The code is a lot more 
concise as well :) 
Using locator() instead of x,y coord was suggested by Tom and that 
showed me where my problem was. The legend was being created just not 
where it would be visible.
I found this bit of code in the R-help archives and it makes thing a 
lot more straightforward when positioning a legend

## set the range of the usr coordinates to x = (0,1), y = (0,1) 
opar <- par(no.readonly=TRUE) 
par(usr=c(0,1,0,1)) 

## add the legend
legend(0.75,0.9,sub(".csv","",nfiles), pch=1:length(nfiles), cex=0.7)

Cheers