我正在使用 ggplot2 制作一些带有图例的密度图,但我无法在最终结果中添加图例。
m <- ggplot(chickwts, aes(x = weight))
m + geom_density(kernel = "gaussian", adjust = .3, colour="green", size=1)+
geom_density(kernel = "gaussian", adjust = 1, colour="red", size=1)+
geom_density(kernel = "gaussian",adjust = 5, colour="blue", size=1)+
geom_density(kernel = "gaussian",adjust = 10, colour="yellow", size=1)+
geom_density(kernel = "gaussian",adjust = 20, colour="orange", size=1)
我使用了几种在这里找到的语法,但没有一个不起作用。谢谢你。