smartlegend {gplots}R Documentation

Place a legend in a specified logical ("top","bottom", "left", "right", etc) location on a plot.

Description

This function places a legend in a specified logical ("top","bottom", "left", "right", etc) location on a plot.

Usage

smartlegend(x = c("left", "center", "right"),
            y = c("top", "center", "bottom"),
            ..., inset = 0.05)

Arguments

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.

Value

Same as legend

Author(s)

Gregory R. Warnes warnes@bst.rochester.edu

See Also

legend

Examples


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)


[Package gplots version 2.6.0 Index]