Live data from Hacker News

Gnuplotlib: A gnuplot-based plotting backend for NumPy

github.com

21–30 of 69 posts

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

#22
post #19

The HN post title should probably not include "non-painful" given that the README never uses that phrase or compares against other plotting libraries.

Why?

HN rules say: “… please use the original title, unless it is misleading or linkbait; don't editorialize.”

Therefore, the title should be “gnuplot for numpy.”

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

#23
post #3

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

I always find it easier to produce publication-quality figures using gnuplot (but not with its defaults settings, mind you) than with Matplotlib. Check out http://gnuplotting.org/ Also, it's hard to beat gnuplot's speed refreshing a live scatter plot with many thousands of points using the x11 terminal.

I'm using gnuplot for plotting too (the actual gnuplot application not a library that uses gnuplot as its backend).

And I usually keep computation and plotting separate. Computation produces data files, and a gnuplot script generates plots. This separation of computation and plotting allows updating charts later if needed, collected data can be reused in other plots, and additional data analysis can be performed and charts can be augmented.

So I personally don't see many advantages from integrating chart generation into computational pipeline itself (except for computation monitoring or maybe when user response is needed to direct computation). Because of that, libraries that encourage charts generation from a computed array instead of dumping that data into persisted files feels like an anti-pattern to me.

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

#24
post #3

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

    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])

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

#25
post #3

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

Nothing, really. I have been using matplotlib for years and it's... fine. The only problem I have is that is has number of minor annoyances that are never getting fixed, despite being well known and the project actively maintained. From the top of my head: the Tk backed not supporting DPI scaling on GNU/Linux; the aspect="equal" not working on 3D plots; covered parts of 3D objects appearing in front of the objects covering them, twin axes not having the origin aligned, etc.

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

#26
post #24
post #3

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

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.

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

#28

Earlier quoted context omitted.

I always find it easier to produce publication-quality figures using gnuplot (but not with its defaults settings, mind you) than with Matplotlib. Check out http://gnuplotting.org/ Also, it's hard to beat gnuplot's speed refreshing a live scatter plot with many thousands of points using the x11 terminal.

I'm using gnuplot for plotting too (the actual gnuplot application not a library that uses gnuplot as its backend). And I usually keep computation and plotting separate. Computation produces data files, and a gnuplot script generates plots. This separation of computation and plotting allows updating charts later if needed, collected data can be reused in other plots, and additional data analysis can be performed and…

Completely aeree. I keen computation steps (which create csv files) separate from charting steps. I use make to orchestrate pipelines. I also keep everything under source control, and insert git commit ids into every chart. This ensures that all the analysis and charts can be linked directly to the code used to produce them.

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

#29

Earlier quoted context omitted.

Why?

HN rules say: “… please use the original title, unless it is misleading or linkbait; don't editorialize.” Therefore, the title should be “gnuplot for numpy.”

I understand, thanks for the explanation.

It makes a whole lot of sense.

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

#30
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 with it.

I would love a version of matplotlib which lives in a separate process and gets updated via nonblocking communication.

Post reply on HN