Skip to content

Instantly share code, notes, and snippets.

@cararthompson
Created December 8, 2022 13:57
Show Gist options
  • Select an option

  • Save cararthompson/8e9451341cde62c5e89f878c3b8e6edf to your computer and use it in GitHub Desktop.

Select an option

Save cararthompson/8e9451341cde62c5e89f878c3b8e6edf to your computer and use it in GitHub Desktop.
waffle background
# Output 1 - retains white space around the plot
plot +
waffle::geom_waffle(aes(fill = species,
values = n),
colour = "lightblue",
make_proportional = FALSE,
size = 2) +
theme(plot.background = element_rect(fill = "lightblue",
color = "lightblue"))
# Output 2 - white space is gone!
waffle_plot <- plot +
waffle::geom_waffle(aes(fill = species,
values = n),
colour = "lightblue",
make_proportional = FALSE,
size = 2)
cowplot::plot_grid(waffle_plot) +
theme(plot.background = element_rect(fill = "lightblue",
color = "lightblue"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment