如何在R中的欧拉图中更改字体大小?

时间:2019-01-15 02:33:48

标签: r plot

我正在尝试使用eulerr包在R中创建Euler图。我想减小绘图上数量文本的字体大小。

我尝试使用cex=0.5(如下例所示),也尝试过fontsize =font =,但没有一个减小字体大小。我将cex=0.5放在错误的位置了吗?

    library(eulerr)

    set1 <- euler(c("A&B" = 3103,
            "A&C" = 1034,
            "A&D" = 118,
            "B&C" = 2690,
            "B&D" = 1017,
            "C&D" = 1383,
            "A&B&C" = 394,
            "A&B&D" = 73,
            "A&C&D" = 45,
            "B&C&D" = 153,
            "A&B&C&D" = 32))

    eulerr.plot <- plot(set1,
                fills = list(fill = c("#009292", "#FFB6DB", "#B66DFF", "#6DB6FF"), alpha = 0.7),
                labels = NULL, quantities = TRUE, legend = list(labels = c("A", "B", "C", "D")), cex = 0.5)

1 个答案:

答案 0 :(得分:1)

您可以通过将定义大小的列表传递给该参数来更改数量的文本大小,如下所示:

plot(set1,  fills = list(fill = c("#009292", "#FFB6DB", "#B66DFF", "#6DB6FF"), alpha = 0.7),
                    labels = NULL, quantities = list(cex = .5), legend = list(labels = c("A", "B", "C", "D")))

enter image description here