CHAPTER 21
Beginner
Geographic and Map Visualizations
Updated: May 18, 2026
5 min read
# CHAPTER 21
Geographic and Map Visualizations
1. Chapter Introduction
When your data has a geographic dimension — sales by country, stores by city, disease spread by region — maps communicate what tables never can. This chapter creates choropleth maps, bubble maps, and location-based analytics using Plotly.2. Choropleth Map (Country-Level)
python
3. Bubble Map (City-Level)
python
4. Common Mistakes
-
Using sequential colormap for growth data: Growth can be negative or positive — use diverging
RdBuwithcolorcontinuousmidpoint=0so 0% = white.
- Bubble maps without size legend: Viewers can't interpret bubble size without a reference. Always include sizemax and a clear title explaining what size encodes.
5. MCQs
Question 1
Choropleth map encodes values using?
Question 2
colorcontinuousmidpoint=0 in Plotly?
Question 3
scope='usa' in scattergeo?
Question 4
Diverging colormap for geographic growth data?
Question 5
Bubble map encodes quantity using?
Question 6
locations='ISOAlpha' tells Plotly?
Question 7
hoverdata={'Revenue': ':$,.0f'} shows on hover?
Question 8
showocean=True, oceancolor='lightblue' in geo?
Question 9
Best map type for comparing values across countries?
Question 10
City-level granularity requires?
6. Interview Questions
- Q: What is a choropleth map and when do you use it?
- Q: How does a bubble map differ from a choropleth map?
7. Summary
Geographic visualizations: choropleth for country/region-level values (color = value), bubble map for location points (size = value). UseRdBu with midpoint=0 for growth/change data. Plotly's px.choropleth handles country matching via ISO codes. Always include hover data for interactive detail.