All my newsletter issues are now available online. Share them with a friend!
β
π Hi! β Last week I shipped a whole new module about annotation in my matplotlib journey online course π. β I also shared with you a few thoughts about how legends should often be replaced by annotation. β I shared this graph to illustrate my idea: β
Graph by Joseph Barbier for the Python Graph Gallery and Matplotlib Journey.
β
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. π
β See you next week,
β
Yan β βPS: if you're a python user, note that my Matplotlib Journey project will be released totally at the end of the month! β PPS: I'm here to help! Any topic you would like me to talk about, please hit reply! β