Best way to use Python to make 2d XY scatter graphs? WillTKinter do it?
Tim Churches
tchur at optushome.com.au
Mon Oct 27 14:41:38 EST 2003
Pat Bills wrote:
> Subject: Re: Best way to use Python to make 2d XY scatter
> graphs? WillTKinter do it?
> I would like to add a possible solution to those suggested.
> This may be
> off-topic and I don't know the context of the question. I, too,
> abandoned Excel as my graphing platform.
>
> If you are automating research processes and not writing software for
> distribution then I think the R environment (http://r-project.org) is
> worth a look. I've used it for several research projects and created
> graphs for publication. There are Python packages to call R
> from python,
Walter Moreira's RPy package ( http://rpy.sf.net ), which embeds an R
interpreter within Python and allows data to be passed between the two
works a treat (at least with R v1.7.1 - there may be issues with R
v1.8.0).
> although complete programs can be written in R, which to my
> newbie eyes
> is very Python-like.
R uses the S langage, which is primarily a functional language, driven
by vector and array-based data structures (all 1-based, not zero-based).
Procedural code is possible in R but tends to be clumsy and discouraged.
However, Python and R complement each other beautifully - Python for
data management and large scale programme structure, R for perfroming
specific analyses and creating charts and graphics.
> The graphs can written to several formats (see
> below) and can paste into your favorite word/presentation processor.
>
> The added bonus is you get a wealth of statistical processes
> along with
> plotting (although you didn't mention this requirement in
> your post).
>
> There are several downsides: your program would require R to
> be installed
> on the system; batching R on windows does not work (for me);
> there is a
> learning curve; and parameters are a bit quirky (work like globals).
>
> http://r-project.org http://www.omegahat.org/RSPython/index.html
Another charting package worth looking at is Ploticus (
http://ploticus.sf.net ) - there is a Python interface but it is broken
for the most recent version of Ploticus. Nevertheless, Ploticus is easy
to call via a shell or a pipe. A wide range of high quality graphs, easy
to drive, and GPLed (as is R). To me, Ploticus appears to be a worthy
successor to the aging GNUplot.
Tim C
More information about the Python-list
mailing list