Learn R Programming

ggguides (version 1.1.4)

legend_none: Remove Legend from Plot

Description

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

Usage

legend_none()

Arguments

Value

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

See Also

legend_left, legend_right

Examples

Run this code
library(ggplot2)

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

Run the code above in your browser using DataLab