怎样才能情节3D叠加柱状图在研发? [英] How does one plot a 3D stacked histogram in R?

查看:259
本文介绍了怎样才能情节3D叠加柱状图在研发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想绘制在研发堆积直方图;即堆叠在第三维单个直方图。

I want to plot stacked histograms in R; i.e. stack individual histograms in the third dimension.

感谢大家的建议,尤其是一个接巴蒂尔。

thank you all for your suggestions, especially the one by Shane.

@hadley,我同意你的观点,但是,我的情况就不同了:主穴我想通过绘制4堆叠柱状图传达的是,尾部变化显著....,将获得遮蔽的部分在数据没有结果我presenting ....还能够读取频率轴上也并不重要,因为我将绘制的相对频率...

@hadley, I agree with your points, however, my situation is different: the main point I'm trying to convey by plotting four stacked histograms is that the tails vary significantly....the part that will get obscured is of no consequence in the data I'm presenting....also, being able to read the frequency axis is also not important since I'll be plotting the relative frequencies...

推荐答案

您可以尝试使用任何 RGL 看到这里)或者 3dscatterplot (如< A HREF =htt​​p://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=116相对=nofollow>在这个例子中)。莱迪思还支持这样的:

You could try using either rgl (see here) or 3dscatterplot (as in this example). Lattice also supports this:

library(lattice) 
library(latticeExtra) 
?panel.3dbars

您可以看到这样的例子<一href="http://learnr.word$p$pss.com/2009/07/20/ggplot2-version-of-figures-in-lattice-multivariate-data-visualization-with-r-part-6/"相对=nofollow>在Learnr博客。

You can see an example of this on the Learnr blog.

我不相信这是一个技术上叠加柱状图(一叠加柱状图堆栈的酒吧在彼此的顶部)。此外,不同类型的直方图可以更翔实:看 GGPLOT2 这里一些实例文档。

I don't believe that's technically a stacked histogram (a stacked histogram stacks the bars on top of each other). Moreover, a different kind of histogram could be more informative: look at the ggplot2 the documentation here for some examples.

 hist_cut <- ggplot(diamonds, aes(x=price, fill=cut)) 
 hist_cut + geom_bar() # defaults to stacking 

另一种选择是使用网络化,而不是与 facet_wrap 在GGPLOT2(见<一href="http://learnr.word$p$pss.com/2009/07/02/ggplot2-version-of-figures-in-lattice-multivariate-data-visualization-with-r-part-4/"相对=nofollow>这个帖子作为一个例子)。

Another option is to use latticing instead, with facet_wrap in ggplot2 (see this post as an example).

这篇关于怎样才能情节3D叠加柱状图在研发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆