ggplot2 avoid boxes around legend symbols

前端 未结 1 1750
南方客
南方客 2020-12-08 18:29

Consider the example plot below. I\'d like to make the little boxes around each of the symbols in the legend go away. How an I do this?

 ggplot(mtcars, aes         


        
相关标签:
1条回答
  • 2020-12-08 19:07

    You're looking for:

     + opts(legend.key = theme_blank())
    

    You can see lots of examples of all sorts of this stuff in ?opts. I couldn't remember off the top of my head which one it was, so I just tried a few until I got it right.

    Note: Since version 0.9.2 opts has been replaced by theme:

    + theme(legend.key = element_blank())
    
    0 讨论(0)
提交回复
热议问题