Make a Choropleth Map of Continuous Variables with ggplot2 (02_07)
For this exercise I took to Twitter to find a dataset that makes DC distinct from the states of US (in 2020).
Use the your-turn script in
02_07w to make this map, ensuring to add a guide item for District of Columbia which does not contain any federal prisons. You’ll need to go through the same steps I did:
- Create an NA aeshetic
- Override the guide aesthetics
- Set the
na.valuefor the fill aesthetic
In this video I talk about viridis being the single best choice for a continuous color palette. This is because the color palette works well for folks with colorblindness and is perceptually uniform – which means it’s easy to know if you’re looking at a low or high value on the scale.