RAndom NoTeS


  • Home

  • About

  • Archives

  • Tags

Hide One or More Legends in ggplot2

Posted on 2015-08-25   |  

This is actually pretty simple thanks to this StackOverflow post.

To disable the legend of a scale being shown in the legend, just set guides(SCALE_NAME=FALSE), the follwing example ignores the legend of color.

1
ggplot(mpg, aes(x=cty,y=hwy,color=manufacturer,shape=class)) + geom_point() + guides(color=FALSE)
#ggplot2
Ugly Number
Graph Traversal -- DFS, BFS, and BFS From Both Sides
  • Table of Contents
  • Overview
Baoxu(Dash) Shi

Baoxu(Dash) Shi

18 posts
1 categories
47 tags
GitHub Twitter

This post does not have a Table of Contents

© 2015 - 2016 Baoxu(Dash) Shi
Powered by Hexo
Theme - NexT.Muse