R:如何在R中的散点图的“点”上重叠饼图 [英] R: How to overlay pie charts on 'dots' in a scatterplot in R

查看:1775
本文介绍了R:如何在R中的散点图的“点”上重叠饼图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用RI想要通过显示附加值的饼图替换二维散点图中的点。



后面的理由是我有时间序列数据来自生物实验的数百个元件(蛋白质)监测4种条件。我想在y轴上绘制元素(分类数据),并在x轴上绘制时间上的事件的发生。为了可视化4个条件之间的相对发生,我想以饼图或圆圈图的形式将其可视化,将它们叠加到散点图中的相应点上。
总体数据密度很低,所以重叠不会是一个问题。



这是否可能在R?
我正在考虑在ggplot2中使用手动缩放,但无法确定如何将饼图定义为缩放。



解决方案

是的。 pieGlyph() Rgraphviz 包中的一个即用型功能。



此外, A如何更广泛地做这样的事情:



如何用两种颜色填充单个pch点?



特别是从 TeachingDemos 包中查看?my.symbols p>

最后,关于 ggplot2 ,您应该查看此博客文章关于可能的即将推出的功能:



http://blog.revolutionanalytics.com/ 2011/10 / ggplot2-for-big-data.html


Using R I would like to replace the points in a 2d scatter plot by a pie chart displaying additional values.

The rational behind is that I have time series data for hundreds of elements (proteins) derived from a biological experiment monitored for 4 conditions. I would like to plot the elements (categorial data) on the y axis and occurrence of a event in time on the x axis. To visualize the relative occurrence between the 4 conditions I would like to visualize this in form of a pie chart or doughnut chart overplayed onto the respective point in the scatter plot. The overall data density is low so overlapping won't be an issue.

Is this possible in R? I was thinking of using a manual scale in ggplot2 but could not figure out how to define a pie chart as a scale.

Also of interest would be how to best cluster this data and sort it accordingly.

解决方案

Yes. pieGlyph() is one ready-to-go function from the Rgraphviz package.

Also, I would check out this Q/A for how to do things like this more generally:

How to fill a single 'pch' point on the plot with two-colours?

Especially check out ?my.symbols from the TeachingDemos package.

Lastly, in regards to ggplot2, you should check out this blog post about possible upcoming features:

http://blog.revolutionanalytics.com/2011/10/ggplot2-for-big-data.html

这篇关于R:如何在R中的散点图的“点”上重叠饼图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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