fit <- euler(c("A" = 10, "B" = 5, "A&B" = 3))
plot(fit, fill_opacity = 0.7)
# Change to italic roman font, remove borders and switch colors
plot(fit, fill = c("dodgerblue4", "darkgoldenrod1"), lwd = 0,
fontface = "italic")
# Add counts to the plot
plot(fit, counts = TRUE)
# Add a custom legend and retain counts
plot(fit, counts = TRUE, key = list(space = "bottom", columns = 2))
# Plot without fills and distinguish sets with border types instead
plot(fit, lty = c("solid", "dotted"), fill = "transparent", cex = 2,
fontface = 2, labels = c("foo", "bar"))
# Plot a grid of euler plots
dat <- data.frame(
A = sample(c(TRUE, FALSE), size = 100, replace = TRUE),
B = sample(c(TRUE, TRUE, FALSE), size = 100, replace = TRUE),
gender = sample(c("Men", "Women"), size = 100, replace = TRUE),
nation = sample(c("Sweden", "Denmark"), size = 100, replace = TRUE)
)
e_grid <- euler(dat[, 1:2], by = dat[, 3:4])
plot(e_grid, key = TRUE)
# We can modify the grid layout as well
plot(e_grid, layout = c(1, 4))
Run the code above in your browser using DataLab