library(ggplot2)
# Plot with multiple legends
p <- ggplot(mtcars, aes(mpg, wt, color = factor(cyl), size = hp)) +
geom_point()
# Hide the size legend
p + legend_hide(size)
# Hide multiple legends
p + legend_hide(size, colour)
Run the code above in your browser using DataLab