views:

2674

answers:

5

I've started on a project graphing tomcat logs using gnuplot-py, specifically correlating particular requests with memory allocation and garbage collection. What is the collective wisdom on gnuplot-py vs matplotlib for python graphing. Are there better graphing libraries out there I haven't heard of?

My general considerations are:

  • While gnuplot has large amounts of documentation, gnuplot-py doesn't. How good is documentation community for matplotlib?
  • Are there things which gnuplot can do but gnuplot-py can't?
  • Does matplotlib have better python support?
  • Are there are big show stopping bugs in either? Annoyances?
  • Currently gnuplot is graphing 100,000's of points, I'm planning on scaling this up to millions. Should I expect problems? How well does matplotlib handle this?
  • Ease of use, turnaround time for gnuplot vs matplotlib?
  • How easy would it be to port existing gnuplot-py code to matplotlib?

How would you approach this task?

+8  A: 

matplotlib has pretty good documentation, and seems to be quite stable. The plots it produces are beautiful - "publication quality" for sure. Due to the good documentation and the amount of example code available online, it's easy to learn and use, and I don't think you'll have much trouble translating gnuplot code to it. After all, matplotlib is being used by scientists to plot data and prepare reports - so it includes everything one needs.

One marked advantage of matplotlib is that you can integrate it with Python GUIs (wxPython and PyQt, at least) and create GUI application with nice plots.

Eli Bendersky
+13  A: 
  • you can check the documentation yourself. i find it quite comprehensive.
  • i have very little experience with gnuplot-py, so i can not say.
  • matplotlib is written in and designed specifically for python, so it fits very nicely with python idioms and such.
  • matplotlib is a mature project. nasa uses it for some stuff.
  • i've plotted tens of millions of points in matplotlib and it still looked beautiful and responded quickly.
  • beyond the object-oriented way of using matplotlib is the pylab interface, which makes plotting as easy as it is in matlab -- ie very easy.
  • as for porting, i have no idea.
Autoplectic
The only plus I can say for gnuplot is that matplotlib does not have 3D plotting capabilities. Besides that, I've used both an prefer matplotlib by far.
vgm64
@vgm64: current SVN has 3d added back in. i haven't tested any of it myself, so i can't say how nice it is. for 3d plotting i use mayavi2: http://code.enthought.com/projects/mayavi/ .
Autoplectic
matplotlib now has a [3D toolkit](http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/index.html#mplot3d)
Kit
+3  A: 

I have played with both, and I like Matplotlib much better in terms of Python integration, options, and quality of graphs/plots.

Corey Goldberg
A: 

Is there a way to use MatPlotLib within Matlab?

The plot produced with MatPlotLib seems much prettier.

Drazick
Hi Drazick, As your post is a question, not an answer, you should ask it by posting a question. http://stackoverflow.com/questions/ask
e5
+2  A: 

After using GNUplot (with my own Python wrapper) for a long time (and really not liking the 80s-looking output), I just started having a look at matplotlib. I must say I like it very much, the output looks really nice and the docs are high quality and extensive (although that also goes for GNUplot). The one thing I spent ages looking for in the matplotlib docs is how to write to an image file rather than to the screen! Luckily this page explains it pretty well: http://www.dalkescientific.com/writings/diary/archive/2005/04/23/matplotlib%5Fwithout%5Fgui.html

Wim