Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Plot the population of Han Chinese in Taiwan from Wikipedia
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()
@benmarwick

This comment has been minimized.

Copy link
Owner Author

@benmarwick benmarwick commented Sep 13, 2019

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment