Python wants R's dataviz crown
I've been working in dataviz for quite a while now, and one thing has always amazed me:
R > Python for dataviz
There are far more Python users worldwide. Yet when it comes to visualization, R still leads the way.
Why?
Partly because ggplot2 changed everything. Its syntax is so powerful and flexible. And partly because the community keeps pushing it further. Every week you see jaw-dropping charts made with ggplot2 and a new extension.
With matplotlib? Not so much.
It's not Matplotlib's fault
Matplotlib is the backbone of Python dataviz. It's extremely powerful: you can build anything with it.
Don't believe me? Check out my list of the best Python charts. They're just as good as the R ones. Just fewer in number.
But:
- its syntax is tricky,
- the docs can be overwhelming, and
- it doesn't come with the same ecosystem of extensions that R enjoys.
The jungle of extensions
R has a package for everything:
- Need a beeswarm?
ggbeeswarm. - A Sankey diagram?
ggsankey. - A streamgraph?
ggstream. - Text that follows a curve?
geomtextpath.
The list is endless.
That's why I built a curated selection on the R Graph Gallery to help people navigate it.
Just a few of my curated collection of best R packages.
In Python, you don't risk getting lost in a jungle. Because the jungle simply doesn't exist.
Closing the gap
But things are changing.
Two years ago, I hired Joseph Barbier. He helped me with the graph galleries for a while, and is now consulting on his own!
He knows matplotlib inside out and has been releasing new Python packages that make dataviz easier and more beautiful.
This week, he dropped bumplot, a library for bump charts. What used to take dozens of lines of code now fits in just a few.
bumplot is on GitHub — try it and give it a star!
And that's not all: Joseph has also built packages for custom fonts, selecting an awesome color palette, and even experiments to make matplotlib interactive.
We also teach dataviz with Python together in a project called Matplotlib Journey!
The outlook
Python is still behind R in dataviz.
But with Posit investing in Python support (Shiny, Quarto, Pydi-tuesday), and with developers like Joseph pushing the ecosystem forward, the gap is narrowing.
The future of dataviz in Python looks genuinely exciting.
PS: Huge thanks to the 68 people who joined Productive R Workflow recently!
See you next week, it's getting late here!
Yan
Enjoyed this?
Get one short, actionable dataviz tip every Saturday. Join 19,000+ data people.