OverviewTeaching: 5 min Exercises: 15 minQuestions
What kind of scientific question does a stacked area chart address?
How do I generate a stacked area chart with
To generate a stacked area chart using
Let students walk through decision making steps from question to chart.
Implement faceted table of histograms.
Chart Improvement Challenge
Here is a incomplete (or bad) example of the chart we are going for. Modify the code to a publication quality stacked area chart.
total_pop_continent<- pop_by_continent %>% group_by(continent, year) %>% summarize(tot_pop = sum(population)/1000000000) ggplot(total_pop_continent, aes(as.numeric(year), tot_pop, group = continent)) + geom_line(position = "stack")
ggplot(total_pop_continent, aes(as.numeric(year), tot_pop, fill = continent)) + geom_area() + labs(x = "Year", y = "Population [billions]", fill = "Continent") + theme_classic(base_size = 24, base_family = "Helvetica") + theme(axis.title = element_text(size = 36))
Stacked area charts represent a composition changing over time.