[Matrix-SIG] Python interface for PPGPLOT
Scott M. Ransom
ransom@cfa.harvard.edu
Tue, 20 Oct 1998 01:09:57 +0000
Greg Hammett wrote:
> Hi,
>
> I've done a little dabling with Numerical Python. I was puzzled by your
> recent message on interfacing to PPGPLOT. You said you wanted:
>
> > The reason for doing such a ludicrous sounding thing is to make high
> > quality 1D and 2D plotting as blatantly easy from Python as it is in
> > IDL, Matlab, etc... And the end result is that it does (pretty much)
>
> but Livermore's Numerical Python distribution
> http://xfiles.llnl.gov/python.htm already includes interfaces to at least 2
> different plotting packages (gist and an oop plotting package) that allow
> one to do this. Is there some advantage to PPGPLOT over those packages, or
> are you just more familiar with the naming conventions in PPGPLOT? I just
> thought I'd save you some time if you didn't know about these already.
>
> Greg
Good question. There are a few reasons why I decided to write my own instead
of using the LLNL packages:
1. I have used PGPLOT before, in both its 'C' and Perl variants, and was
quite impressed with the quality of the output as well as the large number of
device types that it supports (and therefore I also knew the syntax).
2. PGPLOT is _very_ common in the astronomical community. And being an
astronomer, almost every single computer I could dream of running Python with
graphics on, already has PGPLOT installed. (whereas Gist or Yorick are
virtually unheard of).
3. I wanted to create plotting commands much like IDL's, where you can get a
professional looking plot with only a single command. This is, of course,
probably possible with Gist/OOG, but I have only dabbled with the demos and
not done much else.
4. PGPLOT allows you to have a second X or Y axis with different ranges and
labels. While I know that Gist allows the 2nd label, I am not sure that it
supports the 2nd set of ranges (please correct me if I am wrong). These
secondary axes are very important for my current work.
5. I wanted a fairly simple (but useful) project to undertake to help me
learn Python for my current project -- using Parallel Python with graphics and
NumPy on large MPP machines as a glue language for a large 'C' pulsar search
code I have written.
Could I have accomplished all of this with Gist/OOG? Sure. Why not? But now
people using Tim Pearson's PGPLOT along with Nick Patavalis' PPGPLOT under
Python have another little addition to their bag of tricks. And isn't that
what open source is all about?
Personally, I think that the best bet for a publication-quality plotting
library for Python lies in the already very good GNU Plotutils
(http://www.gnu.org/software/plotutils/plotutils.html). The use of postscript
fonts allows for terrific looking plot labels/titles. Once the scripting
language interfaces are in place (I believe their goal is to have calls from
all of the popular scripting languages) I don't think that many other
libraries will be able to touch it (for 2D graphics -- we will still need a
high-quality 3D solution which includes axes and labeling, IMHO). And of
course it uses GPL and should be portable to any platform on the planet.
Scott
--
Scott M. Ransom
Phone: (580) 536-7215 Address: 703 SW Chaucer Cir.
email: ransom@cfa.harvard.edu Lawton, OK 73505
PGP Fingerprint: D2 0E D0 10 CD 95 06 DA EF 78 FE 2B CB 3A D3 53