VennDiagram有问题吗? [英] Problems with VennDiagram?
问题描述
我成功地使用了这里给出的配方.但是,在过去的几天中,这似乎不起作用.我的sessionInfo()
看起来如下:
I have used the recipe given here with a lot of success. However, for past few days this does not seem to work. My sessionInfo()
looks as follows:
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin9.8.0/x86_64 (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 base
other attached packages:
[1] VennDiagram_1.5.1
loaded via a namespace (and not attached):
[1] tools_2.15.2
我尝试了以下操作,但未产生任何结果:
I tried the following, and did not produce any result:
require(VennDiagram)
venn.diagram(list(B = 1:1800, A = 1571:2020),fill = c("red", "green"), alpha = c(0.5, 0.5), cex = 2,cat.fontface = 4,lty =2, fontfamily =3, filename = "trial2.emf")
但是没有产生任何结果.
But did not produce any result.
我做错什么了吗?
推荐答案
一种解决方法是使用png()
或pdf()
保存图.我们首先确认可以使用grid.draw()
在屏幕上绘制该图:
One work-around is to use png()
or pdf()
to save the plot. We first confirm that we can draw the plot onscreen using grid.draw()
:
library(VennDiagram)
temp <- venn.diagram(list(B = 1:1800, A = 1571:2020),
fill = c("red", "green"), alpha = c(0.5, 0.5), cex = 2,cat.fontface = 4,
lty =2, fontfamily =3, filename = NULL)
grid.draw(temp)
已经确认,要保存它,我们要做的就是在pdf()
和dev.off()
Having confirmed that, all we need to do to save it is repeat the grid.draw()
between pdf()
and dev.off()
library(grDevices)
pdf(file="venn.pdf")
grid.draw(temp)
dev.off()
pdf()
和png()
如其帮助文件中所述,具有用于控制图像尺寸之类的参数,从而改善了对图像质量的控制.
As described in their help files, pdf()
and png()
have arguments for controlling things like the size of the image, improving control over image quality.
这篇关于VennDiagram有问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!