library(ggplot2)
# Add legend title to a specific aesthetic
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() + easy_add_legend_title(col = "Number of Cylinders")
# Add legend title to all aesthetics
ggplot(mtcars, aes(wt, mpg, colour = cyl)) +
geom_point() + easy_add_legend_title("Number of Cylinders")
Run the code above in your browser using DataLab