If you Google “data visualization in Python”, most of the tutorials you’ll see will mostly cover matplotlib. The truth is that, yes, matplotlib is very powerful and flexible tool but at the same time very low-level and hard to use. So, plenty of wrappers emerged on top of it.

The most famous wrapper is seaborn. It is very high-level and has sensible defaults to make nice looking commonly used charts with a call to a single function.

My personal favorite is plotnine, I use it all the time when I need to visualize something. It’s based on the idea of “the grammar of graphics” introduced in R library ggplot2. The idea is pretty simple. In ggplot2 (and so in plotnine) the visualization consists of multiple layers: data (a data frame), aesthetics (what rows and aggregations to use for ox, oy, color, etc.), and one or more geometries (a way to visualize data using the aesthetic, like boxplot, bars, etc.). There are also “facets”, “scales”, and “stats”, but they are also just layers.

Why this is cool:

  1. It’s easy to learn, explain, and understand.
  2. It’s easy to use and it’s not so much code.
  3. It’s flexible, you can make any visualizations and combine them in any manner you want.

This is why the recent alpha release of seaborn (v0.12.0a1) introduced Next-generation seaborn interface. The article nods to ggplot2 and plotnine as the sources of inspiration for the new interface. But it also says the interface will be different and more “Pythonic”. All that sounds very cool. Maybe, the new seaborn will win my heart over plotnine ❤️

Both libraries are one-man projects. That’s crazy how much time some people can invest in a single project without getting paid. I was there but I gave up at some point on dephell when I just couldn’t sleep at night for hours because of anxiety about unresolved issues… Be mindful of your health, folks.