Live data from Hacker News

Plotnine: A grammar of graphics for Python

github.com

1–10 of 40 posts

Re: Plotnine: A grammar of graphics for Python

#3

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.

I too am interested in what the differences are. I have used the yhathq ggplot library for a while and it is quite useful but I sometimes find it lacking certain types of plots and documentation.

Also the last commit to the yhathq ggplot library was on Nov 20, 2016, so this library looks like it is currently more active in development.

Edit: Someone made an article comparing the two here: http://pltn.ca/plotnine-superior-python-ggplot/

Re: Plotnine: A grammar of graphics for Python

#4

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.

- 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.

Re: Plotnine: A grammar of graphics for Python

#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?

Re: Plotnine: A grammar of graphics for Python

#6
Recreating and keeping up with Hadley's hard work is challenging, particularly because ggplot2's layout and extensions are really nice and continue to evolve.

As an alternative that preserves the full power of Wickham's implementation, pygg[1] is a Python wrapper that provides R's ggplot2 syntax in Python and runs everything in R.

[1] https://github.com/sirrice/pygg

Re: Plotnine: A grammar of graphics for Python

#7
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?

> Is this "grammar of graphics" any good if you invest more time in it?

For some, it was probably one of THE things that kept them using R over something else. Yes, definitely worth it.

Re: Plotnine: A grammar of graphics for Python

#8
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?

I find it the opposite. The syntax is the most intuitive of all plotting applications.

Layers are as follows [1]

1. Data

2. Aesthetic mappings

3. Statistical transformation (stat)

4. Geometric object (geom)

5. Position adjustment

Once you get a hang of this, it becomes easy to create new plots purely from the understanding of the layers. In matplotlib or even in Seaborn, I find myself constantly Googling for examples.

ggplot2 is the most beautiful thing to happen in visualization space!

[1] Wickham, Hadley, and Carson Sievert. "4.4.1 Layers." Ggplot2: Elegant Graphics for Data Analysis. Dordrecht: Springer, 2016. N. pag. Print.

Re: Plotnine: A grammar of graphics for Python

#9
post #4

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.

- 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 plotnine also leverages matplotlib and produces nicer plots for some common cases :).

Re: Plotnine: A grammar of graphics for Python

#10
Another grammar of graphics: altair[1]. The altair are simpler and easier to read, i.e.

        Chart(df).mark_point().encode(
    x='age', y='height', color='sex')
Also, see Jake Vaderplas's talk on an overview of Python visualization tools at https://youtube.com/watch?v=FytuB8nFHPQ

[1]:https://altair-viz.github.io

Post reply on HN