Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个ggplot图表
q3 <- ggplot(y, aes(T,C))+ geom_line()
和核密度
den <-density(y$C)
如何在 y 轴上叠加内核密度图?
谢谢你的帮助
跟进 DWin 的想法,这可能是您正在寻找的东西:
dat <- data.frame(x = 1:100, y = 1:100, z = rnorm(100)) ggplot(dat) + geom_point(aes(x = y/100,y = x/100)) + geom_density(aes(x = z)) + coord_flip()
x注意 中的和y美学的颠倒geom_point。
x
y
geom_point