Subject: Re: G94 cube file to gnuplot (3D data)

From: Guido Germano <[email-masked]>
Date: Thu, 6 Aug 1998 11:58:25 -0400 (EDT)

> I am looking for a simple program / shell script, which converts density
> data from a G94 cube file to a data file suitable for gnuplot to
> generate a 3D surface plotable with 'splot'.

Write this into a file called e.g. grid.awk, setting N to the
appropriate value:

BEGIN {N = 100}
NF == 1 {print $0; i++}
i == N {print ""; i = 0}

Then issue the command (I suppose you are working under Unix)

awk -f grid.awk g94_file.grid > gnu_file.grid

You can also avoid writing gnu_file.grid to disk, issuing directly from
the gnuplot prompt the command:

splot '< awk "BEGIN {N = 100}; NF == 1 {print $0; i++}; i == N {print
\"\"; i = 0} g94_file.grid' notitle w l 

You can write the above line into a file called e.g. splot.gnu and then
issue from the gnuplot prompt:

load 'splot.gnu'

Freundliche Gruesse

Dr. Guido Germano

Research Assistant in Theoretical Physics, University of Bristol, England
Tel. +44-117-928 8755, http://www.phy.bris.ac.uk/staff/germano_g.html