有没有办法为匿名 geom_function 设置图例名称?
我设法为不同种类的鸢尾花找到一个图例,但也想为我的产品线提供一个标签。
非常感谢!
data("iris")
iris %>%
ggplot(aes(x=Sepal.Length, y=Sepal.Width, shape=Species))+
geom_point()+
geom_function(fun=~.x^(1/2))
如果您需要 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")
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)