R语言 如何在三重维恩图中打开缩放?

g6baxovj  于 2023-03-27  发布在  其他
关注(0)|答案(2)|浏览(147)

我试图建立下面的图表,但它必须是可能的(见图片),我有一个关于负区的错误。
我还需要我的图表缩放。

grid.newpage()                                        # Move to new plotting page
draw.triple.venn(area1 = 153,                          # Different color for each set
                 area2 = 173,
                 area3 = 224,
                 n12 = 2,
                 n23 = 26,
                 n13 = 8,
                 n123 = 140,
                 col = "red",
                 fill = c("pink", "green", "orange"), scaled = TRUE)
p5fdfcr1

p5fdfcr11#

如果你想让图的大小与每个区域所包含的数量成比例,你应该使用eulerr包。注意,在你的例子中,三个区域之间的重叠太大了,以至于几乎不能再被识别为维恩图:

library(eulerr)

plot(euler(c(
       "a" = 3, "b" = 5, "c" = 50,
       "a&b" = 2, "a&c" = 8, "b&c" = 26,
       "a&b&c" = 140
   )), quantities = TRUE,
   fills = scales::alpha(c("pink", "green", "orange"), 0.3))

1cosmwyk

1cosmwyk2#

你必须确保你的面积在参数中正确地求和,如下所示:

library(VennDiagram)
grid.newpage()                                        # Move to new plotting page
draw.triple.venn(area1 = 153,                          # Different color for each set
                 area2 = 173,
                 area3 = 224,
                 n12 = 142,
                 n23 = 166,
                 n13 = 148,
                 n123 = 140,
                 col = "red",
                 fill = c("pink", "green", "orange"), scaled = TRUE)

#> (polygon[GRID.polygon.1], polygon[GRID.polygon.2], polygon[GRID.polygon.3], polygon[GRID.polygon.4], polygon[GRID.polygon.5], polygon[GRID.polygon.6], text[GRID.text.7], text[GRID.text.8], text[GRID.text.9], text[GRID.text.10], text[GRID.text.11], text[GRID.text.12], text[GRID.text.13], text[GRID.text.14], text[GRID.text.15], text[GRID.text.16])

创建于2023年3月20日,使用reprex v2.0.2

相关问题