agg_legend.Rd
Add a legend to the graph
agg_legend(ncol = NULL, x = NULL, y = NULL)
ncol | (optional) Specify the number of columns in the legend (if left blank, arphit will guess) |
---|---|
x | (optional) Specify a location _on_ the plot for the legend. If omitted, the legend is added beneath the graph. x can be one of "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center" to have the legend automatically placed in that location. Alternatively, you can supply a value between 0 and 1 (and a y coordinate) to place a legend in a specific place on the graph. (0,0) corresponds to the bottom left corner, (1,1) top right. Multipanels are ignored for the purposes of on-panel legends - graphs are treated as a whole and panels are ignored. |
y | (optional) Only required if x is a numeric. y-location for on-panel legend. Must be between 0 and 1. See above for more detail. |
vignette("plotting-options", package = "arphit")
for a detailed description of
all the plotting options
data <- data.frame(x = 1:10, y = 1:10) arphitgg(data) + agg_line(agg_aes(x = x, y = y)) + agg_legend()#>