A one-liner to arrange legend keys vertically. This is the default for legends placed on the left or right of a plot.
Examples
library(ggplot2)
# Explicitly set vertical direction
ggplot(mtcars, aes(mpg, wt, color = factor(cyl))) +
geom_point() +
legend_right() +
legend_vertical()