[R] Legend

Mark Miller mmiller at nassp.uct.ac.za
Sun Nov 13 13:37:11 CET 2005


I use the following to plot two graphs over each other and then insert a 
legend, but the two items in the legend both come up the same colour

x = seq(0,30,0.01)
plot(ecdf(complete), do.point=FALSE, main = 'Cummlative Plot of Monday IATs 
for Data and\n Fitted PDF over Entire 15 Weeks')
lines(x, pexp(x,0.415694806),col="red")
legend(x=5,y=0.2 , legend=c("Data Set","Fitted PDF"),col=c("black","red"))

Many thanks
Mark Miller




More information about the R-help mailing list