Skip to contents

A one-liner to remove the legend from a plot. Cleaner alternative to theme(legend.position = "none").

Usage

legend_none()

Value

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

Examples

library(ggplot2)

# Remove legend
ggplot(mtcars, aes(mpg, wt, color = factor(cyl))) +
  geom_point() +
  legend_none()