我该如何从这段代码生成的图例中删除字母'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))
ggplot2
3.2.1 中将show.legend
设为FALSE
将完全删除图例! - NelsonGonggplot2
3.3.5 中,show.legend=FALSE
可以保留整体图例。 (b) 我很惊讶发现这个问题有多么困难。 - learner