EULERR-package Venn-diagram RGB-colors

418 Views Asked by At

The Euler package is one of the few packages, which can made the the Venn diagram where the areas of circles change.

I have this following code, and it makes me a beautiful venn-diagram:

tiff("test.tiff", units="in", width=7, height=5, res=600)
fit <- euler(c(A = 1657, B = 105, "A&B" = 65, C = 407, 
"A&C" = 657, "B&C" = 138, "A&B&C" = 228))
plot(fit, fills = c("skyblue", "plum", "sandybrown"), quantities = TRUE)
dev.off()

BUT, I want to determine the colors using RGB-codes:

tiff("test.tiff", units="in", width=7, height=5, res=600)
fit <- euler(c(A = 1657, B = 105, "A&B" = 65, C = 407,
 "A&C" = 657, "B&C" = 138, "A&B&C" = 228))
plot(fit, fills = c("#CDCDCD", "#5EACCAB", "#E6A176"), quantities = TRUE)
dev.off()

This gives me an error: "Error in grDevices::col2rgb(rcol_in) : invalid RGB specification"

Is it possible with this package to specify colors using rgb codes? I have noticed that X11-color names (https://en.wikipedia.org/wiki/X11_color_names) work fine, but their range is narrow.

1

There are 1 best solutions below

2
On

Color #5EACCAB doesn't exist. Look, I changed it:

fit <- euler(c(A = 1657, B = 105, "A&B" = 65, C = 407, 
                "A&C" = 657, "B&C" = 138, "A&B&C" = 228))
plot(fit, fills = c("#CDCDCD", "#666666", "#E6A176"), quantities = TRUE)

enter image description here

P.S. If you work often with color, I advice you the RColorBrewer package.