Live data from Hacker News

Plotnine: A grammar of graphics for Python

github.com

11–20 of 40 posts

Re: Plotnine: A grammar of graphics for Python

#11
post #5

This is nice and all, but the syntax and names are totally unintuitive. If I'm to dig in the manual, I might as well build my plots with the standard syntax of any random plotting library. Is this "grammar of graphics" any good if you invest more time in it?

Yes, it's worth investing the time. Grammar of graphics is life changing if data visualization is part of your day to day.

Re: Plotnine: A grammar of graphics for Python

#12
post #4

Earlier quoted context omitted.

- yhat's ggplot has 256 commits, 13 contributors, last commit Nov 2016. - plotnine has 1,283 commits, 42 contributors, most recent commit is 3 days ago.

These comparisons are pointless. Would you like to compare loc as well? How about man hours spent? The only comparison that is important is how well the two projects work. I have no idea how well plotnine works yet (but I intend to find out). I do know that ggplot works OK - and seeing as it leverages matplotlib if there is anything that isn't implemented I can finish the plot off manually. EDIT it seems that plotnin…

It's not pointless at all. For long-term maintenance, the community strength and level of active development is just as important (and sometimes more important) than minor feature differences.

Re: Plotnine: A grammar of graphics for Python

#13
I feel like a lot of attempts to recreate ggplot2 end up being superficial because they don't recognize / duplicate the power of the underlying Grid graphics that ggplot2 uses.

I know that web technologies are all the rage these days, but at least for static, publication-ready graphics, Grid is really nice substrate, with well thought out lower-level abstractions.

EDIT: I should also add that it's documented within an inch of its life should anyone feel that it's worth recreating: https://stat.ethz.ch/R-manual/R-devel/library/grid/html/grid...

Re: Plotnine: A grammar of graphics for Python

#15

What is meant by "a grammar"? Is it the way we concatenate functions to create what's essentially a sentence of what we want the plot to be?

I found http://r-statistics.co/ggplot2-Tutorial-With-R.html helpful to learn about the gglplot "grammar of graphs"

Re: Plotnine: A grammar of graphics for Python

#16

If this is an implementation of ggplot2, what does it offer over http://ggplot.yhathq.com/ ? I don't mean to undermine your project, just wanted to know about significant differences.

Plotnine is a real grammar of graphics. Checkout http://plotnine.readthedocs.io/en/stable/about-plotnine.html for a little more information about the two projects.

Re: Plotnine: A grammar of graphics for Python

#17

What is meant by "a grammar"? Is it the way we concatenate functions to create what's essentially a sentence of what we want the plot to be?

ggplot2 was inspired by: https://www.amazon.com/Grammar-Graphics-Statistics-Computing...

and Hadley Wickham wrote about it in http://vita.had.co.nz/papers/layered-grammar.pdf.

I'm no expert, but I think that one of the main ideas is to separate the elements of making a plot from the way that the data is presented. For example, in ggplot2, you have the data that will go into the graph, the type of plot (or "geometry") that defines how the data are presented (scatterplot, bar plot, etc.), and then various "layers" that can be added that affect style.

In order to split a plot into subplots, you simply define how it is to be faceted (what column should be used to define groups). Grammar-of-graphics moves plotting away from the "turtle graphics" model and lets you specify what should be done. Then ggplot figures out how to do it, kind of like SQL vs. writing for loops to retrieve information.

Re: Plotnine: A grammar of graphics for Python

#18
post #12

Earlier quoted context omitted.

These comparisons are pointless. Would you like to compare loc as well? How about man hours spent? The only comparison that is important is how well the two projects work. I have no idea how well plotnine works yet (but I intend to find out). I do know that ggplot works OK - and seeing as it leverages matplotlib if there is anything that isn't implemented I can finish the plot off manually. EDIT it seems that plotnin…

It's not pointless at all. For long-term maintenance, the community strength and level of active development is just as important (and sometimes more important) than minor feature differences.

I would often rather use a decade-old project that was developed solo by a world-class expert dumping code over the wall once every 6 months than a community project being hacked on by 100 amateurs.

Without additional context I find recency of last commit and number of committers to be almost impossible to draw useful conclusions from.

Re: Plotnine: A grammar of graphics for Python

#19

I feel like a lot of attempts to recreate ggplot2 end up being superficial because they don't recognize / duplicate the power of the underlying Grid graphics that ggplot2 uses. I know that web technologies are all the rage these days, but at least for static, publication-ready graphics, Grid is really nice substrate, with well thought out lower-level abstractions. EDIT: I should also add that it's documented within a…

In what way does eschewing the underlying Grid graphics make a less desirable experience for a ggplot2 port?

Re: Plotnine: A grammar of graphics for Python

#20
Surprise to see this at the top, I am the creator* of plotnine. The most common question seems to be, what to expect of plotnine? The answer; a high quality implementation of a grammar of graphics with an API that closely matches ggplot2, and more.

I also want other packages to be able to build off of plotnine, e.g. a package with the functionality of Seaborn could be built off of plotnine. The only constraint should be whether the backend -- in this case Matplotlib -- does stand in the way. Matplotlib is evolving (though slowly) and has a very receptive community so there is lots of hope.

* - Many people contributed to its history.

Post reply on HN