为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

慕哥9229398 2019-09-02 09:10:43
如何从此代码生成的图例中删除字母“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))
查看完整描述

3 回答

?
呼啦一阵风

TA贡献1802条经验 获得超6个赞

设置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 )


查看完整回答
反对 回复 2019-09-02
  • 3 回答
  • 0 关注
  • 2210 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信