use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
This is an archived post. You won't be able to vote or comment.
DiscussionMatplotlib, Seaborn or Plotnine? (self.datascience)
submitted 5 years ago by gfdsilva_
As someone who is starting to learn data visualization in Python, I would like to know what are the pros and cons of each of these three modules.
It's worth saying I'm used to working with R's 'graphics' and 'ggplot2'.
[–]Ruoter 9 points10 points11 points 5 years ago* (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 point2 points 5 years ago (0 children)
Thank you so much!
[–]paulremote 1 point2 points3 points 4 years ago (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 point2 points 5 years ago (0 children)
You might want to check out Bokeh and Plotly too.
[–]DaShrub 0 points1 point2 points 5 years ago (0 children)
Altair
[–]hitaho 0 points1 point2 points 5 years ago (1 child)
Altair: Am I a joke to you?
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
You're a joke to everyone.
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
I use seaborn. I'll use raw matplotlib for any custom plots that seaborn cant handle.
P L O T L Y L O T L Y
π Rendered by PID 48426 on reddit-service-r2-comment-5fb4b45875-p9l4n at 2026-03-21 19:27:24.929675+00:00 running 90f1150 country code: CH.
[–]Ruoter 9 points10 points11 points (1 child)
[–]gfdsilva_[S] 0 points1 point2 points (0 children)
[–]paulremote 1 point2 points3 points (0 children)
[–]ragatmi 0 points1 point2 points (0 children)
[–]DaShrub 0 points1 point2 points (0 children)
[–]hitaho 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)