如何绘制 4 组维恩图
我有四组 ID(存储在单独的文本文件中),我想创建一个维恩图来显示这些组如何重叠。我能够将列表粘贴到 此 Web 应用程序 中并获得一个简单的图表,但我正在寻找一些我可以更多控制的东西(颜色,图形大小等)。有什么建议吗?我的第一个想法是 R,但我乐于尝试任何东西。
I have four sets of IDs (stored in separate text files) and I would like to create a Venn diagram showing how these sets overlap. I was able to paste the lists into this web app and get a simple diagram, but I'm looking for something over which I have a bit more control (colors, graphic size, etc). Any suggestions? My first thought would be R, but I'm comfortable trying anything out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
那么,在提供的应用程序中,您只是在固定图像上绘制文本,对吧?您希望能够使用您自己的颜色创建四组维恩图吗?在这种情况下,您应该可以使用几乎任何服务器端脚本语言,即 PHP 或 ASPX。如果您的解决方案固定为四组(或更少),则适当放置省略号应该是简单的数学运算。 ImageMagick 应该可以在许多社区开发的编程语言中实现这一点。
So, in the provided app you are just painting text on top of a fixed image, right? And you want to be able to create Venn-diagrams with four sets with your own colors? In that case you should be fine with pretty much any server side scripting language, i.e. PHP or ASPX. If your solution is fixed to four sets (or less), placing the ellipses appropriately should be simple math. ImageMagick should i.e. do the trick in many community-developed programming languages.
这可能有点过头了,但是 python 与 matplotlib 怎么样?使用Python的内置集合类型,计算交集和并集是很简单的(例如
set1 ^ set2
用于交集)。然后,matplotlib 可以相对轻松地生成高质量的图表。该库还允许用户广泛定制图形的呈现,包括图形大小和颜色。至于matplotlib中的维恩图,您可以在其存档中找到一个简单的示例 邮件列表。
It might be overkill, but how about python with matplotlib? With python's built-in set type, computing intersections and unions is trivial (e.g.
set1 ^ set2
for intersection). Then, matplotlib can generate high quality graphs with relative ease. The library also let its users customize presentation of graphs extensively including figure size and colors.As for venn diagram in matplotlib, you can find a simple example in the archive of its mailing list.
今天刚刚发布了一个新的 R 包(请参阅 BioMed Central 的文章)。该软件包可以绘制最多 4 组维恩图。
A new R package was just published today (see the article at BioMed Central). This package can plot Venn diagrams with up to 4 sets.
有一个python包, matplotlib-venn,用于绘制最多 3 组比例维恩图。
There is a python package, matplotlib-venn, for plotting proportional Venn diagrams up to 3 sets.
我能够使用 creately 创建漂亮的维恩图。您必须注册才能保存和导出您的数据,但该帐户是免费的。我在 matplotlib_venn 由于某种原因无法给出良好结果的情况下使用它。
I was able to create good-looking Venn diagrams using creately. You have to sign up to be able to save and export your figures, but the account is free. I use it in cases where matplotlib_venn does not give good results for one reason or another.