【问题标题】:How to Change Venn Diagram Font如何更改维恩图字体
【发布时间】:2019-06-14 03:00:19
【问题描述】:

我正在尝试将维恩图的字体更改为 arial。

基于之前的堆栈溢出问题VennDiagram without group names and with Arial font 我尝试将 fontfamily ="arial" 添加到代码中,但没有奏效。

venn.plot <- draw.quad.venn(
area1 = 72,
area2 = 86,
area3 = 50,
area4 = 52,
n12 = 44,
n13 = 27,
n14 = 32,
n23 = 38,
n24 = 32,
n34 = 20,
n123 = 18,
n124 = 17,
n134 = 11,
n234 = 13,
n1234 = 6,
category = c("Workshops", "STEM Tours", "Summer Apprenticeships", 
"Convocation"),
fill = c("antiquewhite4", "cornflowerblue", "gold1", "lightpink2"),
lty = 0, #this gets rid of border
fontfamily ="arial",
cex = 1, 
cat.cex = 2,
cat.col = c("antiquewhite4", "cornflowerblue", "gold1", "lightpink2")
);

【问题讨论】:

标签: r


【解决方案1】:

在我的系统 (Win64) 中,安装 extrafont 后,您需要运行 font_import()(需要一段时间),然后运行 ​​loadfonts(device = "win")。然后您可以执行wf &lt;- windowsFonts() 之类的操作并探索wf。就我而言,我可以使用 wf$Arial 访问 Arial,但使用 YMMV。另外,请记住,组的名称在 cat.fontfamily 参数中。如果您想要 Arial 中的所有内容,

venn.plot <- draw.quad.venn(
    area1 = 72,
    area2 = 86,
    area3 = 50,
    area4 = 52,
    n12 = 44,
    n13 = 27,
    n14 = 32,
    n23 = 38,
    n24 = 32,
    n34 = 20,
    n123 = 18,
    n124 = 17,
    n134 = 11,
    n234 = 13,
    n1234 = 6,
    category = c("Workshops", "STEM Tours", "Summer Apprenticeships", 
                "Convocation"),
    fill = c("antiquewhite4", "cornflowerblue", "gold1", "lightpink2"),
    lty = 0, #this gets rid of border
    fontfamily = wf$Arial,
    cex = 1, 
    cat.cex = 2,
    cat.fontfamily = wf$Arial,
    cat.col = c("antiquewhite4", "cornflowerblue", "gold1", "lightpink2")
);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-19
    相关资源
    最近更新 更多