Most people seem to use matplotlib as a Python plotting library, but is it really the best choice? π€
We are going to compare 5 free and popular libraries:
βͺοΈ Matplotlib
βͺοΈ Seaborn
βͺοΈ Plotly
βͺοΈ Bokeh
βͺοΈ Altair
Which one is the best? Find out below π
In a survey I did the other day, matplotlib had the most users by a large margin. This was quite surprising to me since I don't really like it...
But let's first look at each library π
Matplotlib π
Matplotlib is one of the most popular libraries out there.
β
Supports many types of plots
β
Lots of customization options
β Plots look ugly
β Limited interactivity
β Not very intuitive to use
Seaborn π
Seaborn is built on top of Matplotlib, so it inherits many of its features.
β
Supports many types of plots
β
Plots look very nice
β Limited interactivity
β Not very intuitive to use
β You need to use maplotlib for many configurations
Plotly π
Plotly is a popular library for interactive visualizations.
β
Plots look nice
β
Lots of customization options
β
Easy to use (especially plotly express)
β
Great interactivity (even by default)
β Could be slow for big amounts of data
Bokeh π
Another cool interactive plotting library.
β
Plots look nice
β
Lots of customization options
β
Good interactivity (but not as good as plotly)
β Missing plot types (especially 3D)
Altair π
A less popular, but very interesting library based on the Vega project.
β
Plots look nice
β
Lots of customization options
β
Good interactivity (but not as good as plotly)
β Slow
β Cumbersome to use
β Embeds all data in the visualization leading to huge files
The Winner π₯
My personal favorite is plotly. I like it because it is very easy to use, offers great interactivity by default and the plots look nice.
Furthermore, plotly also offers a JavaScript version, so it can be practical if you need to show some data on the web.
Now it's your turn...
Which Python plotting library do you prefer? Why? Have you tried plotly? Feel free to try to convince me that there is a better library! π
If you want to learn plotly I find the official documentation quite good. They also have lots of examples you can build on.
Start here: plotly.com/python/creatinβ¦
This is a valid strategy, however, sometimes you just want to do a quick plot to visualize your data.
I think it is very important to keep the friction of displaying data to a minimum. Otherwise you just won't do it sometimes - a missed opportunity.
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.