24

I am generating a plot using the code below and would like to hide the "mag" (size) legend but still keep the "depth" (color) legend.

ggplot(quakes, aes(long, lat, size=mag, colour=depth)) + geom_point()

1 Answer 1

34

Try:

... + scale_size(guide="none") # As of Mar 2012

... + scale_size(legend = FALSE) # Deprecated
2
  • 1
    This still works, but I get a message saying "legend" argument is deprecated and to use guide="none". So ... + scale_size(guide="none") is the new syntax.
    – ARobertson
    Mar 19, 2012 at 21:53
  • I keep trying to update these old answer, but it's tough to keep up! Oct 29, 2012 at 5:30

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.