[Matrix-SIG] How to a la IDL, TV, matrix_array

Scott Ransom ransom@cfa.harvard.edu
Tue, 17 Oct 2000 13:43:07 -0400


Sidey Timmins wrote:
>
>     As a new pythoner I am very impressed with Numpy.
>     But surely you can (via Tkinter) display a raster matrix easily.
>     (I dont want to write a file and then display a jpeg etc with the imaging
...
> which results in an array zx which looks something like:

Hi Sidey,

One option (especially since you work at NASA where PGPLOT is certainly
installed) is to use the ppgplot and Pgplot modules available from here:

ftp://cfa-ftp.harvard.edu/pub/ransom/

The ppgplot library wraps PGPLOT, and Pgplot is an easy-to-use set of
Python procedures to do interactive plotting (ala IDL).

In your case you would simply do:

from Pgplot import *
plot2d(zx)

to get a plot in an X-window

Postscript output, contours, different color schemes, labeling, etc.,
are only keywords away.

There are other options, of course, see this page for a list:

http://www.python.org/topics/scicomp/plotting.html

Hope this helps,

Scott

-- 
Scott M. Ransom                   Address:  Harvard-Smithsonian CfA
Phone:  (617) 495-4142                      60 Garden St.  MS 10 
email:  ransom@cfa.harvard.edu              Cambridge, MA  02138
GPG Fingerprint: 06A9 9553 78BE 16DB 407B  FFCA 9BFA B6FF FFD3 2989