r venn图部分区域为负

时间:2013-05-30 18:00:10

标签: r venn-diagram

当我使用R绘制维恩图时出现错误。这是代码:

library(VennDiagram)
venn.plot <- draw.triple.venn(
area1 = 2249,
area2 = 2124,
area3 = 2133,
n12 = 2061,
n23 = 2101,
n13 = 2072,
n123 = 2030,
category = c("Human(all)", "Mouse(all)", "Rat(all)"),
col = "black",
alpha=0.5,
fill = c("darkorchid1", "cornflowerblue", "green"),
lty = "blank",
cex = 1,
cat.cex = 2,
cat.col = c("darkorchid4", "darkblue", "darkgreen")
);
tiff(filename = "2.f.tiff", compression = "lzw");
grid.draw(venn.plot);
dev.off();

它给了我一个错误:"draw.triple.venn(area1 = 2249, area2 = 2124, area3 = 2133, n12 = 2061,Impossible: partial areas negative"

为什么我的代码会以此错误结束?

1 个答案:

答案 0 :(得分:0)

你需要检查你的数字/数学。如果您定义了交叉点,则圈数3需要至少有2143个计数,并且您只给它一个2133的区域。

我检查了VennDiagram包的文档,据我所知,area1,area2和area3应该是这些集合的总面积 - 而不仅仅是与其他集合不重叠的子集。

当我完成数学运算时,我分别得到-10和-8,只有3个和2个类别。