有没有办法为匿名geom_function设置图例名称?
我设法为不同种类的鸢尾花获得了一个传奇,但我也想为我的线加上一个标签。
非常感谢!
data("iris")
iris %>%
ggplot(aes(x=Sepal.Length, y=Sepal.Width, shape=Species))+
geom_point()+
geom_function(fun=~.x^(1/2))发布于 2020-09-08 20:40:54
如果您需要ggplot2中的图例,解决方案与以往一样:创建美学映射。
ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, shape=Species))+
geom_point()+
geom_function(fun=~.x^(1/2), aes(linetype = "function")) +
scale_linetype_discrete(name = "some")https://stackoverflow.com/questions/63794025
复制相似问题