Mapping the US presidential election 2016 results
In this example we are going to explain how to create a beautiful map showing the results of the US presidential election in 2016 by state. For this map we will use the election results data from Wikipedia.
The map we are going to create has this url:
You can easily test every step yourself by copying the url and pasting it in the url bar of another browser tab or window.
Creating this map (in 4 simple steps)
In 4 simple steps we get to our final result:
- 1. Select a base map
- 2. Color the states that Trump won
- 3. Center the map
- 4. Finalize the map by coloring the remaining states
1. Select a base map
2. Color the areas
We add the a-param with the area codes of the states that Trump won and define a color to fill those states using the c-param.
3. Center the map
By default the map is centered according to the areas that are colored. In this case we want to show the whole map. By using the nz-param (no zoom) we can show the full map.
4. Finalize the styling
By coloring the remaining states (those won by Clinton), using the fc-param and using white borders (bc-param) we get our final result.