jolars / eulerr

Area-Proportional Euler and Venn Diagrams with Ellipses
https://jolars.github.io/eulerr/
GNU General Public License v3.0
129 stars 18 forks source link

Plotting the Euler diagram with percentages with fractions (decimals) #75

Open JakhongirAlidjanov opened 3 years ago

JakhongirAlidjanov commented 3 years ago

Hi. Dear authors,

I am trying to plot Euler's diagram with counts and percentages of counts related to the total cohort (n=1615). I have written following code:

plot(euler(c(
  "LUTS"=98,
  "Symptoms of UTI"=46,
  "Positive urine culture"=39,
  "Symptoms of UTI&LUTS"=33,
  "LUTS&Positive urine culture"=24,
  "Symptoms of UTI&Positive urine culture"=22,
  "Symptoms of UTI&LUTS&Positive urine culture"=18),
  input = "union",
  shape = "ellipse"),
  key = TRUE, 
  counts = TRUE,
  quantities = list(type = c("counts", "percent"), font=3, round=2, cex=0.8), 
  fills =list(fill=c(viridis::plasma(n = 3))), alpha = 0.3,
  c("#1957FF", "#FF750C", "#FF220C"), alpha = 0.3,
  edges=list(lty = 1),
  factor_names = TRUE,
  labels=list(font=2, cex=1),
  legend = FALSE)

and expectedly have got following : изображение My question is how can one replace the percentages with custom ones, e.g. "59 (3.65%)" instead of "59 (48%)"? Thank you in advance.