powered by
Adds a legend to a plot as does legend. This function just expresses the position relative to the range of the coordinates
legend
legendr(x = 0.05, y = 0.95, legend, ...)
See legend
position in horizontal direction, between 0 for left margin and 1 for right margin
position in vertical direction, between 0 for bottom margin and 1 for top margin
text of the legend
arguments passed to legend
Werner A. Stahel, ETH Zurich
ts.plot(ldeaths, mdeaths, fdeaths,xlab="year", ylab="deaths", lty=c(1:3)) legendr(0.7,0.95, c("total","female","male"), lty=1:3)
Run the code above in your browser using DataLab