Last active
September 13, 2019 00:25
-
-
Save benmarwick/cffb82fb6d9192354d495a2e0ded4e55 to your computer and use it in GitHub Desktop.
Plot the population of Han Chinese in Taiwan from Wikipedia
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) | |
pop_han_in_tw <- tribble( | |
~year, ~population, | |
1684, 120000, | |
1764, 666210, | |
1782, 912920, | |
1811, 1944737, | |
1840, 2500000, | |
1902, 2686356, | |
1926, 4168000, | |
1944, 6269949, | |
1956, 9367661) | |
breaks <- plyr::round_any(seq(min(pop_han_in_tw$year), max(pop_han_in_tw$year), 50), 50) | |
ggplot(pop_han_in_tw, | |
aes(year, population)) + | |
geom_col() + | |
scale_y_log10(labels = scales::comma) + | |
scale_x_continuous( | |
labels = breaks, | |
breaks = breaks) + | |
labs(x = "Year", | |
y = "Population of Han Chinese in Taiwan", | |
caption ="data from Wikipedia") + | |
theme_bw() | |
Author
benmarwick
commented
Sep 13, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment