Created
April 28, 2022 15:32
-
-
Save ivelasq/89346652c6cde63c9741796b9cddd55f to your computer and use it in GitHub Desktop.
Silly plot of Henry VIII's wives
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(dplyr) | |
library(ggplot2) | |
library(emoGG) | |
library(MetBrewer) | |
dat <- | |
tibble::tribble( | |
~queen, ~marriage_start, ~marriage_end, ~reason, ~marriage_age, | |
"Catherine of Aragon", 1509, 1533L, "divorced", 23L, | |
"Anne Boleyn", 1533L, 1536L, "beheaded", 32L, | |
"Jane Seymour", 1536L, 1537L, "died", 29L, | |
"Anne of Cleves", 1540L, 1540L, "divorced", 25L, | |
"Catherine Howard", 1540L, 1542L, "beheaded", 19L, | |
"Catherine Parr", 1543L, 1547L, "survived", 31L | |
) | |
dat_p <- | |
dat %>% | |
mutate(years = marriage_end - marriage_start) | |
dat_p %>% | |
ggplot(aes(x = marriage_start, y = marriage_age)) + | |
geom_segment( | |
aes( | |
x = marriage_start, | |
y = marriage_age, | |
xend = marriage_end, | |
yend = marriage_age + years , | |
color = reason | |
), | |
) + | |
theme_light(base_family = "Baskerville") + | |
theme(legend.position = c(0.2, 0.75), | |
legend.box.background = element_rect(color="grey", size=1)) + | |
geom_emoji(data = dat_p %>% filter(!stringr::str_detect(queen, "Anne of Cleves")), | |
aes(x = marriage_start, y = marriage_age), | |
emoji = "1f478", | |
size = 0.03) + | |
geom_emoji(data = dat_p %>% filter(stringr::str_detect(reason, "divorced")), | |
aes(x = marriage_end, y = marriage_age + years), | |
emoji = "1f494", | |
size = 0.03) + | |
geom_emoji(data = dat_p %>% filter(stringr::str_detect(reason, "beheaded")), | |
aes(x = marriage_end, y = marriage_age + years), | |
emoji = "1f480", | |
size = 0.03) + | |
geom_emoji(data = dat_p %>% filter(stringr::str_detect(reason, "died")), | |
aes(x = marriage_end, y = marriage_age + years), | |
emoji = "1faa6", | |
size = 0.03) + | |
geom_emoji(data = dat_p %>% filter(stringr::str_detect(reason, "survived")), | |
aes(x = marriage_end, y = marriage_age + years), | |
emoji = "1f331", | |
size = 0.03) + | |
labs(title = "Age and Reign of Henry VIII's Wives", | |
y = "Years Old") + | |
geom_text(aes(label = queen), | |
nudge_x = -1.8, | |
nudge_y = 0.3, | |
angle = 45, | |
color = "#696969", | |
family = "Baskerville") + | |
xlim(1500, 1550) + | |
ylim(14, 50) | |
ggsave("queens.png", device = "png", dpi = 300) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment