Learn R Programming

eulerr (version 1.0.0)

plot.eulerr_grid: Plot eulerr plot grid

Description

Plot a grid of eulerr plots.

Usage

"plot"(x, main, mfrow, ...)

Arguments

x
A grid of euler diagrams of class eulerr_grid produced by eulerr.
main
Titles for the euler plots. If not provided, uses grouping variables from eulerr.
mfrow
Number of rows and columns in the grid as a vector of two integers: c(columns, rows).
...
Arguments to pass forward to plot.eulerr.

See Also

plot.eulerr, eulerr, par

Examples

Run this code
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 <- eulerr(dat[, 1:2], by = dat[, 3:4])
plot(e_grid)

# We can provide custom titles for our diagrams

plot(e_grid, main = c("A", "B", "C", "D"))

# and use any options that plot.eulerr takes

plot(e_grid, polygon_args = list(col = "transparent"))

# It is also possible to change grid layout

plot(e_grid, mfrow = c(1, 4))

Run the code above in your browser using DataLab