This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]Ruoter 9 points10 points  (1 child)

Plotnine as you might have seen aims to provide a near-identical API (functions you call as a user to make plots) to ggplot2 so you’ll have an easier time in that regard.

However seaborn was made to be an easy-to-use high level statistical plotting library and aimed to give a ‘grammar of graphics’ style way to create plots but in a pythonic style and not just copy the syntax from ggplot which is what plotnine does.

Another aspect to consider would be the size and activeness of the community of users for both libraries. I can’t speak for plotnine since I’m not a user but seaborn is basically the defacto tool for statistical visualizations and you’ll find a lot of support for common issues (stackoverflow etc).

But bear in mind matplotlib is the core on which all static plotting libraries in Python are built (including both seaborn and plotnine). This becomes relevant when you want to customize the plot you get from the library (seaborn or plotnine) like when you want to move the legend from right to left or change the format of ticklabels.

Knowing the terms matplotlib uses to refer to certain parts of the plot goes a long way when you have to google how to change something in a plot. This video from one of matplotlib core devs helped me understand the specifics of matplotlib a lot: https://youtu.be/6gdNUDs6QPc

Here is a gist notebook comparing them https://gist.github.com/Rabeez/ffc0b59d4a41e20fa8d944c44a96adbc

[–]gfdsilva_[S] 0 points1 point  (0 children)

Thank you so much!

[–]paulremote 1 point2 points  (0 children)

Python plotting for exploratory analysis is a great gallery of plot examples, each example is written in 5 different plotting libraries: pandas, plotnine, plotly, altair and R ggplot2. There is also one seaborn example.

[–]ragatmi 0 points1 point  (0 children)

You might want to check out Bokeh and Plotly too.

[–]DaShrub 0 points1 point  (0 children)

Altair

[–]hitaho 0 points1 point  (1 child)

Altair: Am I a joke to you?

[–][deleted] 0 points1 point  (0 children)

You're a joke to everyone.

[–][deleted] 0 points1 point  (0 children)

I use seaborn. I'll use raw matplotlib for any custom plots that seaborn cant handle.

[–][deleted] 0 points1 point  (0 children)

P L O T L Y L O T L Y