L <- c(Lte,Lin) SA <- c(SAte,SAin) N <- c(Nte,Nin)这三个向量是我选出来的基因位点,L中的位点个数为52个,SA中的位点个数22个,N的个数为47个,我想画好看的环环相扣的韦恩图,展示他们的交集情况
时间: 2024-03-20 18:38:57 浏览: 108
好的,你可以尝试以下代码:
```R
library(VennDiagram)
# 设置韦恩图的参数
venn_list <- list(
L = L,
SA = SA,
N = N
)
venn_colors <- c("red", "green", "blue")
venn_alpha <- c(0.5, 0.5, 0.5)
venn_names <- c("L", "SA", "N")
# 画韦恩图
venn_result <- venn.diagram(
venn_list,
fill = venn_colors,
alpha = venn_alpha,
filename = NULL,
cat.cex = 2,
cat.fontface = "bold",
cat.default.pos = "outer",
cat.dist = c(0.08, -0.1, 0.08),
cat.col = venn_colors,
cat.fontfamily = "serif",
scaled = TRUE
)
# 添加标签和标题
venn_result <- draw.venn(
venn_result,
label.col = venn_colors,
label.fontfamily = "serif",
label.cex = 1.5,
cat.fontfamily = "serif",
cat.cex = 1.5,
main = "Venn Diagram",
sub = "Created by R"
)
# 显示韦恩图
venn_result
```
这个代码会生成一个环环相扣的韦恩图,并且带有标签和标题。你需要将 L、SA、N 替换为你选出来的基因位点向量,然后运行代码即可。
阅读全文