使用VennDiagram包缩放R中的三重维恩图 [英] scaling triple Venn diagram in R with VennDiagram package
问题描述
有人知道如何获取R包VennDiagram来根据集合大小缩放包含3个相交集合的Venn图的圆吗?
Does anyone know how to get the R package VennDiagram to scale the circles of a Venn diagram containing 3 intersecting sets according to set size?
我可以通过Venneular软件包实现这种缩放,但是与VennDiagram相比,在其他图形选项方面我发现这有点限制.
I can achieve such scaling with the venneular package, but I find this a bit limited in terms of other graphical options compared to VennDiagram.
VennDiagram软件包文档建议将参数"scaled"设置为TRUE应该可以解决问题,但是我发现这会产生3个相等大小的圆.
The VennDiagram package documentation suggests setting the argument 'scaled' to TRUE ought to do the trick, but I find this produces 3 circles of equal size.
软件包文档确实暗中暗示了scaled参数仅适用于某些图表:
The package documentation does cryptically suggest that the scaled argument may only work for certain diagrams:
?draw.triple.venn
显示:
已缩放: 布尔值,指示是否根据设置的大小缩放某些欧拉图中的圆的大小"
scaled: "Boolean indicating whether to scale circle sizes in certain Euler diagrams according to set sizes or not"
和
?venn.diagram
#Argument Venn Sizes Class Description
#scaled 2, 3 logical Enable scaling for two-set and certain three-set Euler diagrams.
我的代码的一个玩具示例:
A toy example of my code:
require(VennDiagram)
venn.plot <- draw.triple.venn(
area1 = 70,
area2 = 250,
area3 = 500,
n12 = 30,
n23 = 60,
n13 = 10,
n123 = 5,
category = c("C1", "C2", "C3"),
fill = c("blue", "red", "green"),
scaled=TRUE)
tiff(filename = "test.tiff", compression = "none",type = "quartz",antialias = "none")
grid.draw(venn.plot)
dev.off()
类似地,使用"venn.diagram"功能的此代码不会产生所需的缩放比例:
Similarly this code using the 'venn.diagram' function doesn't produce the required scaling:
venn.diagram(x=list(A=c(1:15,16:20), B=c(6:15,21:30,100:150), C=c(11:30,200:300)),
filename="test.tiff",
fill = c("blue", "yellow", "red"), scaled=TRUE)
非常感谢
吉姆
推荐答案
所以要回答我自己的问题: 对于某些配置,从数学上讲不可能创建一个 用圆按比例缩放三向维恩.
So to answer my own question: for certain configurations it is mathematically impossible to create a scaled 3-way Venn using circles.
这篇关于使用VennDiagram包缩放R中的三重维恩图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!