powered by
A one-liner to arrange legend keys vertically. This is the default for legends placed on the left or right of a plot.
legend_vertical()
A ggplot2 theme object that can be added to a plot.
legend_horizontal, legend_left, legend_right
legend_horizontal
legend_left
legend_right
library(ggplot2) # Explicitly set vertical direction ggplot(mtcars, aes(mpg, wt, color = factor(cyl))) + geom_point() + legend_right() + legend_vertical()
Run the code above in your browser using DataLab