开发者

How to plot venn diagram with 4 sets

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 in开发者_运维技巧to 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.


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.


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.


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.


There is a python package, matplotlib-venn, for plotting proportional Venn diagrams up to 3 sets.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜