Closed syldor closed 5 years ago
I can't reproduce this. Assuming you have the right data from mortality.org, and it's loaded as at the top of lexis.r
, this code:
p_out <- p + geom_raster() +
scale_fill_viridis_c(option = "A", direction = -1) +
scale_x_continuous(breaks = seq(1845, 2015, by = 15)) +
ylim(c(0, 100)) +
guides(fill = guide_legend(nrow = 1, title.position = "top", label.position = "bottom")) +
labs(x = "Year", y = "Age", fill = "Male Death Rate Percentile",
title = "Male Mortality Rates in England and Wales, 1841-2016",
subtitle = "Binned by percentile",
caption = "@kjhealy / http://socviz.co. Data: Human Mortality Database.") +
theme(legend.position = "top",
legend.title = element_text(size = 8))
p_out
Should give you this figure:
Damn, I was plotting the cohort mortality rate instead of the periodic one. Thank you for your answer :)
I have another question. What do you mean by
If you plot the raw mortality rates, what you’ll find is that the wars tend to drown out all the other data in the series, washing out the other trends.
I understand that when we plot the raw mortality rates we only see two patterns appearing:
And I understand that because we cannot see the other trends from your article you decided to take a different "lens" by doing the binning, but why are the war responsible for that?
(I'm really just asking because I find the article amazing and try to fully grasp it and not because I'm looking for issues :))
Thank you for your code and a great visualization. In the blog post, the graph shows up as having a rectangle shape
when in this code it's more of a diamond shape.
How is the correction made and what does it mean?
I feel like I'm not grasping what is actually plotted.