gpt4 book ai didi

R - plot a Venn diagramm with proportions of overlap(R-绘制具有重叠比例的维恩图)

转载 作者:bug小助手 更新时间:2023-10-28 11:13:04 25 4
gpt4 key购买 nike



I am trying to plot a Venn diagramm and I have the following specifications:

我正在尝试绘制一个维恩图,我有以下规格:



# size of g
g <- 97.22
# size of m
m <- 63.89

# overlaps
# i.e. the proportion of size m covered by g
g_covering_m <- 0.9015527
# i.e. the proportion of size g covered by m
m_covering_g <- 0.7253595



# the size of m covered by g
gm <- g_covering_m * m


# plotting
library(eulerr)
vennDiag <- euler(c("g" = g,
"m" = m,
"g&m" = gm))
plot(vennDiag, counts = TRUE,
font=1,
cex=.1)
plot(vennDiag,
edges = list(lty = 3),
quantities = list(type = "counts",
font = 3))


Obviously less than 0.9015527% (=g_covering_m) of the m circle is covered, because eulerr draws this by size.

显然,m圆的覆盖率不到0.9015527(=g_overing_m),因为Eulerr是按大小绘制的。


Now I am wondering how I can get the circles to be drawn in a way, that it represents the specification that I have estimated?
Thanks in advance!

现在我在想,我如何才能让这些圆圈以某种方式画出来,它代表了我估计的规格?提前谢谢!


更多回答

whether or not this is possible with the eulerr package, I strongly recommend against presenting data this way. The area of the overlap region vs. the disk sizes is impossible to interpret visually with any accuracy. If you want the audience to get this quantitative info, use some version of a bar chart or similar layout. If you haven't yet, read Ed Tufte's great books on effective presentation of data.

无论使用eulerr包是否可能做到这一点,我都强烈建议不要以这种方式表示数据。重叠区域的面积与盘大小的关系不可能以任何精度在视觉上解释。如果你想让观众获得这些量化信息,可以使用某种版本的条形图或类似布局。如果你还没有,不妨读一读埃德·塔夫特关于有效表达数据的好书。

Meanwhile: what is "size" ? area? radius? Please be explicit in defining all terms

同时:什么是“大小”?地区?半径呢?请明确定义所有术语

Thanks for your comment Carl. I disagree, though. Interpretability in this case is a matter of resolution. Don't be blended by all the decimal digits, resolution is not that important for me. A venn diagram is the best representation for this data.

谢谢你的评论,卡尔。不过,我不同意这种说法。在这种情况下,可解释性是一个解决问题。不要被所有的小数位混在一起,分辨率对我来说并不那么重要。维恩图是该数据的最佳表示。

oh and size is area. Altough it does not matter, it could be radius as well. Again, a matter of resolution.

哦,大小就是面积。虽然这并不重要,但也可以是半径。再说一次,这是一个需要解决的问题。

优秀答案推荐

It seems that by default the euler function expects numeric values indicating the disjointed set sizes (A∖B, A∩B, B∖A), not their total size (i.e., union, A, B, A∩B). But you can easily change that by supplying the corresponding option:

似乎在默认情况下,Euler函数需要指示不相交的集合大小(A∖B、A∩B、B∖A)的数值,而不是它们的总大小(即UNION、A、B、A∩B)。但是,您可以通过提供相应的选项来轻松地更改这一点:


# sizes
g <- 97.22
m <- 63.89

# proportion of size coverages
g_covering_m <- 0.9015527
m_covering_g <- 0.7253595

# the size of m covered by g
gm <- g_covering_m * m

# plotting
library(eulerr)
vennDiag <- euler(c("g" = g, "m" = m, "g&m" = gm), input="union")
plot(vennDiag, edges = list(lty = 3),
quantities = list(type = "counts", font = 3))

result of above function with input type union


更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com