R:操作方法:使用gplot和geom_density绘制3d密度图 [英] R: How to : 3d Density plot with gplot and geom_density
问题描述
我正在尝试将多个密度图与叠加图结合起来。
ggplot和geom_density可以完成工作,但是密度彼此堆叠。
I'm trying to combine multiple density plots with overlay. ggplot and geom_density do the job, but the densities are stacked on top of each other.
ggplot(all.complete, aes(x=humid_temp)) +
geom_density(aes(group=height, colour=height, fill=height.f, alpha=0.1)) +
guides(fill = guide_legend(override.aes = list(colour = NULL))) +
labs(main="Temperature by Height", x="Temperature", y="Density")
类似这就是我要达到的目标:
Something similar to this is what I'm trying to achieve:
在我的情况下,年份将由身高代替。
In my case, the years would be substituted by height.
谢谢!
推荐答案
我知道这个年龄,但是其他遇到这种问题的人可能会偶然发现这篇文章,因此我想我应该添加一个最近发现的解决方案。刚创建了一个新程序包来完成这种类型的可视化,它名为 ggjoy
,旨在与ggplot2系统配合使用。
I know this old, but other people with this kind of issue may stumble upon this post, so I thought I'd add a recently discovered solution. There is a new package that was just created to do exactly this type of visualization and it is called ggjoy
and is designed to work with the ggplot2 system.
所有信息都可以在这里找到: https://github.com/ clauswilke / ggjoy
All of the info can be found here: https://github.com/clauswilke/ggjoy
希望这会有所帮助!
这篇关于R:操作方法:使用gplot和geom_density绘制3d密度图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!