Thursday, September 25, 2014

vennpieR: combination of venn diagram and pie chart in R

I was wondering how to draw a venn diagram like pie chart in R, to show the distribution of my RNA-seq reads mapped onto different annotation regions (e.g. intergenic, intron, exons etc.). A google search returns several options, including the nice one from Xiaopeng's bam2x (see below). However, he told me it's not released yet. And it's javascript based.

Why not I just make one in R? 

Here is the design scratch:

And here is example code:

Here is output:

You can also use par(mfrow=c(n,m)) to put multiple venn pieagram in one figure. 


  1. This is how I did this with HTML 5:
    More background.

  2. This is more like a combination of regular pie chart and Venn diagram. Is there a single name that you can call this other than vennpier. I like to suggest veppineer diagram :)

    Shalin @ creately

    1. Thanks for visiting, Shalin. I put a capital R at the end, because it's an R code/function. Also it's Ven diagram + Pie + R. But thanks for your suggestion for veppineer.

  3. Great! Thank you so much! when I wrote commands for legend it came on the figure, how I can shift it to the right?