library(ggplot2)
# Remove all legends
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() + easy_remove_legend()
# remove just size legend
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() + easy_remove_legend("size")
# can also use:
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() + easy_remove_legend(size)
# Remove more than one
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() + easy_remove_legend(size, color)
Run the code above in your browser using DataLab