Live data from Hacker News

Gnuplotlib: A gnuplot-based plotting backend for NumPy

github.com

11–20 of 69 posts

Re: Gnuplotlib: A gnuplot-based plotting backend for NumPy

#14
post #3

What's wrong with matplotlib? I might be living under a rock...

Matplotlib has been working fine for me. Some caveats. I'm a physicist working in industry, and don't publish in academic journals. But I do a huge amount of data visualization, for my own use, and to produce graphs for internal reports.

The graphs look as good to my eye as what I see in papers, but I have no idea what extra steps are needed to satisfy each journal's style guide.

Before Matplotlib, I created graphs in Excel.

A possible question is whether Matplotlib deserves the status of being the default for teaching scientific programming in Python, or if a different tool would make it easier for beginners.

Re: Gnuplotlib: A gnuplot-based plotting backend for NumPy

#16
post #13

By far and away the best python plotting library is plotnine, a python clone of ggplot maintained by Hassan Kibirige from Uganda. By the estimation of one esteemed colleague "it obviously pays back the time investment in less than a couple of days". I agree.

I see the potential long term but that api is unintuitive at best. It almost seems obstructively terse.

    (ggplot(mtcars, aes("wt", "mpg", color="factor(gear)"))
     + geom_point()
     + stat_smooth(method="lm")
     + facet_wrap("~gear"))
From https://github.com/has2k1/plotnine, their front page examples. I get that it's ripping off the ggplot api, but why would they not alias "aes" to something more meaningful? It stands for "aesthetic mapping".

My problem with all the popular plotting libraries in python is they seem designed for researchers slapping together a paper and produce code that's awful to maintain.

Re: Gnuplotlib: A gnuplot-based plotting backend for NumPy

#17
Looks great, minor API usability note: I don't know if there is an official convention but when naming an object that has the potential of overriding a builtin, rather than prepending with an underscore, e.g. `_with`, one does append to it: `with_`. The former is used and recognised for unused variables.

> _with is a curve option that indicates how this dataset should be plotted. It’s _with and not with because the latter is a built-in keyword in Python. [1]

- [1] https://github.com/dkogan/gnuplotlib/blob/master/guide/guide...

Re: Gnuplotlib: A gnuplot-based plotting backend for NumPy

#18
post #16
post #13

By far and away the best python plotting library is plotnine, a python clone of ggplot maintained by Hassan Kibirige from Uganda. By the estimation of one esteemed colleague "it obviously pays back the time investment in less than a couple of days". I agree.

I see the potential long term but that api is unintuitive at best. It almost seems obstructively terse. (ggplot(mtcars, aes("wt", "mpg", color="factor(gear)")) + geom_point() + stat_smooth(method="lm") + facet_wrap("~gear")) From https://github.com/has2k1/plotnine , their front page examples. I get that it's ripping off the ggplot api, but why would they not alias "aes" to something more meaningful? It stands for "ae…

do you feel that about Seaborn even? it can be too "on the rails" for some applications, but if the rails meet your needs, the plotting calls look clean and maintainable to me.

Re: Gnuplotlib: A gnuplot-based plotting backend for NumPy

#20
post #16
post #13

By far and away the best python plotting library is plotnine, a python clone of ggplot maintained by Hassan Kibirige from Uganda. By the estimation of one esteemed colleague "it obviously pays back the time investment in less than a couple of days". I agree.

I see the potential long term but that api is unintuitive at best. It almost seems obstructively terse. (ggplot(mtcars, aes("wt", "mpg", color="factor(gear)")) + geom_point() + stat_smooth(method="lm") + facet_wrap("~gear")) From https://github.com/has2k1/plotnine , their front page examples. I get that it's ripping off the ggplot api, but why would they not alias "aes" to something more meaningful? It stands for "ae…

> [...] why would they not alias "aes" to something more meaningful?

This criticism doesn't do anything for me.

Is an alias for a 3 letter function name really going to improve readability / usability? It's the same API. Take it up with Hadley Wickham.

I think having one interface that is the same (ok, "mostly the same") for R and Python is a blessing for people who work with both. I don't graph with Python much, but every time I have to plot in Python I sigh and ask myself if it would be easier to just import the data into R.

Post reply on HN