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.
-
I appreciated the the link to a good online tool for making Venn diagrams – flashton Sep 03 '20 at 13:34
5 Answers
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.

- 3,632
- 1
- 27
- 39
-
It also did the hard work of determining the numbers that should go in each overlapping region. This wouldn't be excruciatingly hard to implement once, but it was nice that I didn't have to worry about that bit. That would be a very nice feature if I were to reuse this often (which I may--thus the question!). – Daniel Standage Jan 05 '11 at 05:07
-
Well, if you already have the logic figured out, I understand this question as one about how to draw ellipses and fill them. Personally I'd use ASPX, but there is a large number of languages that can do this for you. Pick your favorite and google it/edit the question/ask another question. Now that you've come this far, the final bit should be pretty easy. – Pedery Jan 06 '11 at 16:33
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.

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

- 17
- 2
-
2Note there is a feature request for supporting 4 sets https://github.com/konstantint/matplotlib-venn/issues/15 – Franck Dernoncourt Oct 13 '15 at 16:48
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.

- 17,993
- 11
- 78
- 90
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.

- 8,136
- 19
- 69
- 116