Skip to contents

A one-liner to arrange legend keys vertically. This is the default for legends placed on the left or right of a plot.

Usage

legend_vertical()

Value

A ggplot2 theme object that can be added to a plot.

Examples

library(ggplot2)

# Explicitly set vertical direction
ggplot(mtcars, aes(mpg, wt, color = factor(cyl))) +
  geom_point() +
  legend_right() +
  legend_vertical()