rploteulerr

How to change font size in Euler plot in R?


I am trying to create a Euler diagram in R using the eulerr package. I would like to reduce the font size of the quantities text on the plot.

I have tried using cex=0.5 (as per example below) and have also tried fontsize = and font = but none have reduced the font size. Am I placing cex=0.5 in the wrong position?

    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)

Solution

  • You can change the text size of the quantities by passing a list defining the size to that argument like so:

    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