使用美学和geom_text时,从图例中删除“a”

如何从此代码生成的图例中删除字母“a”?如果我删除了geom_text,那么'a'字母将不会显示在图例中。不过我想保留geom_text。


ggplot(data = iris, aes(x = Sepal.Length, y=Sepal.Width, shape = Species, colour = Species)) + 

   geom_point() + 

   geom_text(aes(label = Species))


慕哥9229398
浏览 2230回答 3
3回答

呼啦一阵风

设置show.legend = FALSE为geom_text:ggplot(data = iris,       aes(x = Sepal.Length, y = Sepal.Width, colour = Species, shape = Species, label = Species)) +     geom_point() +    geom_text(show.legend = FALSE)该参数show_guide将名称更改为show.legendin ggplot2 2.0.0(请参阅发布新闻)。预ggplot2 2.0.0:有了show_guide = FALSE这样的...ggplot( data=iris, aes(x=Sepal.Length, y=Sepal.Width , colour = Species , shape = Species, label = Species ) , size=20 ) + geom_point()+geom_text( show_guide  = F )
打开App,查看更多内容
随时随地看视频慕课网APP