smartlegend {gplots} | R Documentation |
This function places a legend in a specified logical ("top","bottom", "left", "right", etc) location on a plot.
smartlegend(x = c("left", "center", "right"), y = c("top", "center", "bottom"), ..., inset = 0.05)
x |
horizontal location on the plot. One of "left", "center" or "right". |
y |
vertical location on the plot. One of "top", "center", or "bottom". |
... |
arguments for legend |
inset |
inset distance from the margin as a fraction of the plot region. |
Same as legend
Gregory R. Warnes warnes@bst.rochester.edu
x <- rnorm(100) y <- rnorm(100, x^2 ) plot(x,y) abline( lm(y~x), col="red", lty=1, type="b") # regression fit lines( lowess(y~x), col="blue", lty=2, type="b") # lowess fit smartlegend(x="center", y="top", c("Regression","Locally Linear Smooth"), col=c("red","blue"), lty=1:2)