A convenience function that returns a theme element to place the legend at the bottom of a ggplot. Commonly used in reports where horizontal space is limited.
Examples
if (FALSE) { # \dontrun{
library(ggplot2)
# Basic usage
ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
geom_point() +
legend_bottom()
# Horizontal legend with left justification
ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
geom_point() +
legend_bottom(justify = "left")
} # }