Created
April 4, 2022 03:07
-
-
Save will-r-chase/38f84952cd0f18370970883303ca3413 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(patchwork) | |
#Solutions | |
#Using charts in plastic_charts.R | |
#Create a patchwork with one chart in a lefthand column | |
#spanning two vertical rows, and two charts in a second column | |
#stacked on top of each other | |
patchwork <- bar_chart | (bar_chart_2 / pie_chart) | |
#Take the patchwork you just created, and add a title, subtitle, and figure labels | |
patchwork + plot_annotation(title = "Plastic pollution", | |
subtitle = "According to beach cleanups", | |
tag_levels = "A") | |
#Make the figure labels read "Fig. 1, Fig. 2, Fig. 3" | |
patchwork + plot_annotation(title = "Plastic pollution", | |
subtitle = "According to beach cleanups", | |
tag_levels = c(1), | |
tag_prefix = "Fig. ") | |
#Use theme options to make the figure labels a little smaller | |
patchwork + plot_annotation(title = "Plastic pollution", | |
subtitle = "According to beach cleanups", | |
tag_levels = c(1), | |
tag_prefix = "Fig. ") & | |
theme(plot.tag = element_text(size = 10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment