如何从此代码生成的图例中删除字母“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 )
- 3 回答
- 0 关注
- 2852 浏览
添加回答
举报
0/150
提交
取消