Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Venn diagram proportional and color shading with semi-transparency

I have following type of count data.

A   450
B   1800
A and B both    230

I want to develop a colorful (possibly semi-transparency at intersections) like the following Venn diagram.

enter image description here

Note: This figure is an example hand drawn in PowerPoint, and it is not to scale.

like image 962
jon Avatar asked Jan 03 '12 14:01

jon


People also ask

Should Venn diagrams be proportional?

Venn diagram is an excellent tool to visualize the relationship among sets. Ideally, the sizes of the circles and their overlapping area should be proportional to the relationship they convey.


2 Answers

Here is a post which discusses Venn diagram from list of clusters and co-occurring factors.

For easy solution use package venneuler:

require(venneuler) v <- venneuler(c(A=450, B=1800, "A&B"=230)) plot(v) 

enter image description here

For more advanced and customized solutions check package VennDiagram.

library(VennDiagram)  venn.diagram(list(B = 1:1800, A = 1571:2020), fill = c("lightblue", "green"),               alpha = c(0.5, 0.5), lwd =0, "venn_diagram.tiff") 

enter image description here

like image 71
Geek On Acid Avatar answered Sep 20 '22 00:09

Geek On Acid


I have recently published a new R package, eulerr, which does what you want. It is quite similar to venneuler but without its inconsistencies.

library(eulerr)
fit <- euler(c(A = 450, B = 1800, "A&B" = 230))
plot(fit)

eulerplot

Or you could try the shiny application for the same r package at eulerr.co

shiny-euler

like image 31
Johan Larsson Avatar answered Sep 22 '22 00:09

Johan Larsson