To stack or not to stack?
Last week I shipped a whole new module about annotation in my Matplotlib Journey online course. I also shared a few thoughts about how legends should often be replaced by annotation.
I shared this graph to illustrate my idea:
Some people replied to me asking some legit questions about this stacked area graph (thanks!)
Soooo, should we stack data like that?
What is a stacked area chart?
A stacked area chart is like a regular area chart, but instead of overlapping, each series is stacked on top of the previous one.
It's useful for showing both the overall trend and how individual groups contribute to the whole.
At first glance, it's a powerful tool!
But… there's a catch.
Consider this variation: a percent stacked area chart. Take a moment and try to figure out how the second group (in green) is evolving:
Is it increasing or decreasing?
Hard to tell, right?
Here's the same data, but with just the green group:
Much clearer! That's the problem. Stacking forces readers to mentally unstack the data, which is a lot of cognitive effort. And let's be honest, most people will misinterpret it.
So, should you avoid stacked charts?
Not necessarily. It depends on the question you're answering:
✅ If you care about the total trend and individual groups are secondary → Stacked charts are fine.
❌ If the focus is on how each group evolves independently → Consider alternatives like line charts or, even better, small multiples.
I've written more about alternatives in my Data to Viz project. Feel free to check it out!
That's it for today! I hope you found this useful! And next time you stack your sandwich, maybe think of me. 😉
Any topic you would like me to talk about? drop me an email!
See you next week,
Yan
Enjoyed this?
Get one short, actionable dataviz tip every Saturday. Join 19,000+ data people.