我有一个包含6个元素的数据集。
我想画一个文氏图,但用R(文氏图库)只能画5个元素。
你知道怎么画一个六组维恩图吗也许和蟒蛇一起?
我的数据示例:

Ath,Fve,Mdm,Pcmm,Pper,Pmum,Counts
1,0,0,0,0,0,901
0,1,0,0,0,0,14764
0,0,1,0,0,0,19408
0,0,0,1,0,0,17714
0,0,0,0,1,0,16849
0,0,0,0,0,1,17572
1,1,0,0,0,0,823
1,0,1,0,0,0,846
...

最佳答案

不久前我写了一个javascript库,可以做到这一点:venn.js。它在您提供的数据集上生成此输出:
在javascript中,但是Kent Russell提供了一个htmlwidgets interface to call it from R
生成此项的代码是:

// define set sizes and their intersection sizes
var sets = [
    {sets: ['Ath'], size: 901},
    {sets: ['Fve'], size: 14764},
    {sets: ['Mdm'], size: 19408},
    {sets: ['Pcmm'], size: 17714},
    {sets: ['Pper'], size: 16948},
    {sets: ['Pmum'], size: 17572},
    {sets: ['Ath', 'Fve'], size: 823},
    {sets: ['Ath', 'Mdm'], size: 846},

    // need to specfiy the rest of the sets don't overlap
    {sets: ['Ath', 'Pcmm'], size: 0},
    {sets: ['Ath', 'Pper'], size: 0},
    {sets: ['Ath', 'Pmum'], size: 0},
    {sets: ['Fve', 'Mdm'], size: 0},
    {sets: ['Fve', 'Pcmm'], size: 0},
    {sets: ['Fve', 'Pper'], size: 0},
    {sets: ['Fve', 'Pmum'], size: 0},
    {sets: ['Mdm', 'Pcmm'], size: 0},
    {sets: ['Mdm', 'Pper'], size: 0},
    {sets: ['Mdm', 'Pmum'], size: 0},
    {sets: ['Pcmm', 'Pper'], size: 0},
    {sets: ['Pcmm', 'Pmum'], size: 0},
    {sets: ['Pper', 'Pmum'], size: 0},
    ];

// draw the chart in the venn div
var chart = venn.VennDiagram();
d3.select("#venn").datum(sets).call(chart);

关于python - 如何使用6套绘制维恩图,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30638610/

10-11 15:53