[R] legends on the outside of the "box"

Laura Holt lauraholt_983 at hotmail.com
Fri Aug 20 04:53:29 CEST 2004


Hi R People:

Here is a simple set of commands:

>x1 <- 1:10
>x2 <- sqrt(x1)
>plot(x1)
>points(x2,col="red",pch=3)
>legend(2,8,legend=c("First","Second"),col=c("black","red"),pch=c(1,3))
>
Fine.
Now, I would like to put the legend box on the outside of the plot itself, 
perhaps in the lower
left hand corner.

I've been messing with mtext, but to no avail.

Any help would be much appreciated.

R Version 1.9.1 Windows
Thanks,
Laura Holt
mailto: lauraholt_983 at hotmail.com




More information about the R-help mailing list