如何从该代码生成的图例中删除字母"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))
如何从该代码生成的图例中删除字母"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))
在geom_text
中设置show.legend = FALSE
:
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
在ggplot2 2.0.0
(see release news)中更名为show.legend
.
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 = FALSE)