Remove the legend in a ggplot

noLegend()

Value

A theme element to hide legend

Examples

# gg <- mpg %>% # filter(class %in% c("compact", "suv")) %>% # ggplot(aes(x = displ, y = hwy)) + # geom_point(aes(colour = factor(year))) + # facet_wrap(~ class, ncol = 2) # gg # gg + noLegend()