# NOT RUN {
fit <- euler(c("A" = 10, "B" = 5, "A&B" = 3))
plot(fit, labels = c("foo", "bar"), fill_alpha = 0.7)
# Customize colors, remove borders, bump alpha, color labels white
plot(fit,
fill_alpha = 0.5,
fill = c("red", "steelblue4"),
col = "white",
border = "transparent",
fontface = "bold.italic")
# Add counts to the plot
plot(fit, counts = TRUE)
# Add a custom legend and retain counts
plot(fit, counts = TRUE, auto.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)
)
gridfit <- euler(dat[, 1:2], by = dat[, 3:4])
plot(gridfit, auto.key = TRUE)
# We can modify the grid layout as well
plot(gridfit, layout = c(1, 4))
# }
Run the code above in your browser using DataLab