[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: publication quality graphs



Hi,

On Fri, 14 Oct 2005, Stuart Prescott wrote:

> Hi again,
>
> thanks for your responses so far -- some interesting ideas
>
> I had a play with PyX some more yesterday and piped the data through the
> aspline utility (package: spline) to get an interpolated smooth curve.
> That worked quite nicely for me (using the python pipes object to stream
> in the data). I'm quite liking pyx as a concept, although I'm still not
> convinced that it's a sustainable approach in the long run.
>
> But I did realise that it's not particularly efficient to be trying to
> do this in python (which I will have to learn to use PyX) instead of
> perl (which I am quite comfortable in). Anyone know of a perl graphing
> module with the power of PyX?

Learning python is not that hard. It takes about
half a day to get (more than) the basics: See e.g.

- for a quick 6 page start - instant python:
  http://www.hetland.org/python/instant-python.php

- More is offered in the python tutorial
  http://docs.python.org/tut/tut.html

And even more links of course on the docs page of python
  http://docs.python.org/tut/tut.html

This one http://www.hackdiary.com/slides/lpw2004/
discusses python for perl programmers, maybe this helps as well.

Personally I even think that you don't have to
go through the above, but just learn while creating the graphics.
PyX (http://pyx.sourceforge.net/)
comes with *many* examples,  see e.g.
 http://pyx.sourceforge.net/examples/graphs/index.html
ranging from simple to very sophisticated.
Especially, when the data are in files, you just have to do

  from pyx import *

  g = graph.graphxy(width=5)
  g.plot(graph.data.file("two_column_data.dat", x=1, y=2))
  g.writeEPSfile("simple")

And that's it ;-).

The quality, accuracy, and the
excellent (La)TeX embedding for the fonts
makes it my number 1 choice for real publication
quality graphs.
(I used to use gnuplot for all my plots,
but converted recently.
For example all the plots in
  http://www.physik.tu-dresden.de/~baecker/pub21.html
were generated with PyX).

Also I should mention that the developers of PyX
are very open to questions/suggestions
(for example I forwarded the evaluation
and they already started to think about the spline
interpolation!).

Let me bring in another one, matplotlib:
  http://matplotlib.sourceforge.net/
See the examples at
  http://matplotlib.sourceforge.net/screenshots.html

It is also based on python and together with
  - ipython http://ipython.scipy.org/
  - Numeric
    (soon to be superseeded by scipy core http://numeric.scipy.org/)
  - scipy http://www.scipy.org/
one gets an excellent framework
for scientific computing in python
(quite similar in many respects with matlab).

Best,

Arnd



Reply to: