我想在一个图中子绘制三个不同的维恩图。我正在VennDiagram
为维恩图使用 R 包。对于子图,我尝试了 grid.arrange() 但它给出了
“arrangeGrob”错误:“arrangeGrob 错误(...,as.table = as.table,clip = clip,main = main,:输入必须是 grobs!”。
以下是我尝试过的代码和我的 R 会话信息:
#VennDiagram:
library(VennDiagram)
A<- draw.pairwise.venn(600, 200, 61, c("X", "Y"), col= rep("gray70", 2), lwd= rep (1, 2), fill= c("skyblue1", "yellowgreen"), cat.pos=0, fontfamily = rep("sans"), cat.fontfamily= rep("sans"), sacled=FALSE)
B<- draw.pairwise.venn(400, 200, 60, c("X", "Y"), col= rep("gray70", 2), lwd= rep (1, 2), fill= c("skyblue1", "yellowgreen"), cat.pos=0,, fontfamily = rep("sans"), cat.fontfamily= rep("sans"), scaled=FALSE)
C<- draw.pairwise.venn(700, 500, 75, c("X", "Y"), col= rep("gray70", 2), lwd= rep (1, 2), fill= c("skyblue1", "yellowgreen"), cat.pos=0,, fontfamily = rep("sans"), cat.fontfamily= rep("sans"), scaled=FALSE)
#For subplot:
library(ggplot2)
library(grid)
library(gridExtra)
grid.arrange(A, B, C, ncol = 3, main = "Venn")
#R sessionInfo
sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] gridExtra_0.9.1 ggplot2_1.0.0 VennDiagram_1.6.9
loaded via a namespace (and not attached):
[1] colorspace_1.2-4 digest_0.6.6 gtable_0.1.2 MASS_7.3-35
[5] munsell_0.4.2 plyr_1.8.1 proto_0.3-10 Rcpp_0.11.3
[9] reshape2_1.4.1 scales_0.2.4 stringr_0.6.2 tcltk_3.1.1
[13] tools_3.1.1
我将不胜感激将不同的维恩图绘制为子图的帮助。