split_plot | R Documentation |
Split plot into multiple subplots
split_plot(
plot,
by,
ncol = NULL,
nrow = NULL,
byrow = NULL,
guides = "collect",
tag_level = NULL,
design = NULL
)
plot |
A |
by |
Variable that should be used for splitting. |
ncol , nrow |
The number of columns and rows per page. |
byrow |
Analogous to |
guides |
A string specifying how guides should be treated in the layout.
|
tag_level |
A string ( |
design |
Specification of the location of areas in the layout. Can either
be specified as a text string or by concatenating calls to |
A tidyplot
object.
# Before splitting
energy |>
dplyr::filter(year %in% c(2005, 2010, 2015, 2020)) |>
tidyplot(y = energy, color = energy_source) |>
add_donut() |>
adjust_size(width = 25, height = 25)
# Split by year
energy |>
dplyr::filter(year %in% c(2005, 2010, 2015, 2020)) |>
tidyplot(y = energy, color = energy_source) |>
add_donut() |>
adjust_size(width = 25, height = 25) |>
split_plot(by = year)
# Change dimensions of subplots
energy |>
dplyr::filter(year %in% c(2005, 2010, 2015, 2020)) |>
tidyplot(y = energy, color = energy_source) |>
add_donut() |>
adjust_size(width = 15, height = 15) |>
split_plot(by = year)
# Spread plots across multiple pages
energy |>
dplyr::filter(year %in% c(2005, 2010, 2015, 2020)) |>
tidyplot(y = energy, color = energy_source) |>
add_donut() |>
adjust_size(width = 25, height = 25) |>
split_plot(by = year, ncol = 2, nrow = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.