Choropleth + Histogram
As you might know I try to share a little dataviz tips & inspiration on LinkedIn every day.
And this week, one post really struck a chord:
The Graph
This map is a choropleth map. It shows the unemployment rate in Belgium.
Originally created by Koen Van den Eeckhout in Tableau, my associate Joseph (co-teacher for our Matplotlib Journey course) recreated it in Python.
Here is a glimpse of his iterative process. We like calling this an "Evolution of a Matplotlib".
Check out the code here! And if you want to learn how to build stuff like that in ~30 minutes, everything is explained in Matplotlib Journey :)
Why It's Awesome
Choropleth + Histogram Combo
Choropleth maps use color to encode values, but they need a legend to provide context.
In this case, the histogram is the legend, doubling as a distribution view for the data. This approach also makes it easier to interpret the map at a glance. Such a win!
Iterative Process
Dataviz and programming are iterative.
We captured this in a GIF showing every step required to build the map. If you think a dataviz masterpiece emerges fully formed, that's not true! It's all about incremental progress!
Design Details
The design here is on point: a well-chosen color scale, precise alignments, and balanced proportions.
Nailing these aspects is one of the hardest parts of dataviz, and studying great examples is the best way to sharpen your eye. I'll write about this soon!
Interactivity
A commenter (Pere Rovira) shared another great example using a similar technique.
It has a neat interactive twist: hovering over a region reveals its value on the legend.
If you build interactive graphs, this little detail is definitely something to consider.
I'll have to add a tutorial on this to the React Graph Gallery soon.
That's It!
That was short but I hope this inspired you to try this approach the next time you build a choropleth map.
A massive thanks to Joseph for pushing the boundaries of what Matplotlib can do!
PS: I'm launching a new project soon with someone I really admire: Cédric Scherer. If you're a R user, you'll love it!
Best,
Yan
Enjoyed this?
Get one short, actionable dataviz tip every Saturday. Join 19,000+ data people.