key(x = 0, y = 0, ..., title="", columns = 1, between.columns = 3, background = 0, align = TRUE, border = 0, between = 2, corner = c(0,1), divide = 3, transparent = FALSE, cex, col, lty, lwd, font, pch, adj = 0, type = "l", size = 5, angle = 0, density, plot = TRUE)
In determining the graphical parameters to use for any particular item, the most important value is the one specified in closest proximity to the item. For example, colors specified in a text= argument are used in preference to the overall col= argument, which, in turn, will be used rather than the current value of the col= graphical parameter. Values of graphical parameters will be reused cyclically. All graphical parameters given to key may be vectors with multiple values.
S device functions are not always precisely able to determine the length of character strings in proportionally spaced fonts, thus strings that are not left-justified may be slightly out of alignment and the use of small values for between may be problematic.
key( text = list(month.name[1:5], col = 1:5, adj = 1), rectangle = list(size = 5), line = list(lty = 2:6, col = 7:8, lwd = 4) )# second column includes both point and line symbols key( text = list(c("Cities", "Roads")), lines = list(type = c("p", "l")) ) key(2, 9, text = list(state.name[1:5]), lines = list(lty = 1:5, type = "o", pch = 1:5), text = list(state.name[1:5], col = 1, font = 2, adj = 1), points = list(pch = "X"), rectangles = list(size = 3), title = "Testing", col = 1:5, cex = 1:5/3, font = 1:5, size = 10, border = T, columns = T, between = 6)