Live data from Hacker News

Gnuplotlib: A gnuplot-based plotting backend for NumPy

github.com

31–40 of 69 posts

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

#31
post #26
post #24

Earlier quoted context omitted.

from matplotlib import pyplot as plt WTF? Broken from right there. What's a plt? "o" key broken? Why didn't they just call it pyplot? Why not just import pyplot pyplot.plot(lambda x: math.sin(x)) pyplot.plot(x=[0,1,2],y=[0,2,4])

People who are making plots in the terminal don't want to type out the fully qualified library name. Majority of plots are written and read only once during data exploration and analysis time.

[deleted]

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

#32
post #3

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

Matplotlib isn't very friendly to casual users.

For even the simplest possible plot, I have to create a subplot and axis.

Sometimes I'd like to just plot a function. I don't want to initialize arrays for that.

It's easy to forget that I have to `import matplotlib.pyplot`

I don't need to plot things often, but whenever I use matplotlib, I always have to spend a few minutes to look up how to use it.

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

#33
post #3

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

Matplotlib is what is wrong with matplotlib..

Broadly, the problem is that its syntax was meant to reflect that of Matlab, which, I guess, makes it intuitive for Matlab users. For the rest of us, it's mostly unintuitive and inconsistent.

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

#34

I don't mind matplotlib at all but I just find it annoying in one of my most important use cases which is to update the plot during a long calculation. You gave to call fig.canvas.draw but it doesn't always work and sometimes plt.pause works but sometimes it only partially updates the display and you have to call it multiple times. (At least this in is my experience with TkAgg backend.) Meanwhile you can't interact w…

Can't be solved by writting output in a file and reading that file in parrallel?

I'm a noob, it's honnest question.

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

#35
post #3

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

Matplotlib is what is wrong with matplotlib.. Broadly, the problem is that its syntax was meant to reflect that of Matlab, which, I guess, makes it intuitive for Matlab users. For the rest of us, it's mostly unintuitive and inconsistent.

Can you give an example of its inconsistency?

I would be genuinely interested what are the inconsistency from a Python-perspective.

I am former Matlab/Octave user. To me the julia interface of matplotlib is actually quite nice to use, but unfortunately the installation is a bit brittle.

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

#36
I might have missed the memo where Gnuplot has a better api than matplot ;)

Seriously though, there have been many attempts to make a "better matplotlib" and yet it's still going strong - mostly because when you really get into scientific plotting and need print quality plots or embed plots in an GUI with very specific parameters it's hard to beat. Sometimes you just need to place a label in a specific spot and that's where a lot of alternatives fall down. That and the multiple very mature backends and library integrations.

P.S. I also highly recommend using the object base API. There's a lot of learning material around the web that still uses the old MatLab inspired plotting api which has a plot of gotchas, the object based one is pretty clean.

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

#39
post #20
post #16

Earlier quoted context omitted.

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, bu…

>Is an alias for a 3 letter function name really going to improve readability / usability?

In this case, absolutely. Plus it shows the attention to detail, or lack thereof, across the whole API.

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

#40
post #3

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

Matplotlib isn't very friendly to casual users. For even the simplest possible plot, I have to create a subplot and axis. Sometimes I'd like to just plot a function. I don't want to initialize arrays for that. It's easy to forget that I have to `import matplotlib.pyplot` I don't need to plot things often, but whenever I use matplotlib, I always have to spend a few minutes to look up how to use it.

>For even the simplest possible plot, I have to create a subplot and axis.

So? Can't that be abstracted away once in a custom lib, of the 3-4 plots you use 99% of the time, and be done with it?

In which case, you just need to pass in your data and labels, in a specific format, and that's it.

Post reply on HN