Description Usage Arguments See Also Examples
View source: R/gg-constructors.R
Add a legend to the graph
1 | 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
1 2 | data <- data.frame(x = 1:10, y = 1:10)
arphitgg(data) + agg_line(agg_aes(x = x, y = y)) + agg_legend()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.