Post

I really liked this idea of using a histogram as a legend in a choropleth map (since land isn't unemployed; people are), so I made a little guide to doing it with #rstats, {ggplot2}, and {patchwork} www.andrewheiss.com/blog/2025/02...

andrewheiss.comHow to use a histogram as a legend in {ggplot2} | Andrew HeissLand isn’t unemployed—people are. Here’s how to use R, {ggplot2}, {sf}, and {patchwork} to create a histogram legend in a choropleth map to better see the distribution of values.

Your map’s legend can be turned into a histogram, helping your audience understand the distribution in addition to decoding the colours.

197 reposts882 likes

Here's one solution!

Andrew Heiss@andrew.heiss.phd

Bonus update! Choropleths are still visually distorted and overrepresent land, so we can instead use points that are sized by population. I added an example at the end to show one way to do this with {sf}'s magical st_centroid() #rstats www.andrewheiss.com/blog/2025/02...

Histogram legends on choropleth maps have an interesting history. It allowed cartographers to visualize the effect of assigning class intervals to whatever was shown. Having seen the effects of different ways to do this (quantiles, divide the range) they could then have fights about what was best

Andrew Heiss@andrew.heiss.phd

Bonus update! Choropleths are still visually distorted and overrepresent land, so we can instead use points that are sized by population. I added an example at the end to show one way to do this with {sf}'s magical st_centroid() #rstats www.andrewheiss.com/blog/2025/02...