passing parameters to a gp 'program'

passing parameters to a gp 'program'

Post by giacomo boff » Thu, 12 Feb 1998 04:00:00



i have devised this kludge, in program1.gp i have:

soil=`echo $soil`

and i launch gnuplot from {,k,ba}sh like this:

% soil=3 gnuplot program1.gp

----------------------------------------------------------------------

it works also with filenames, e.g., if in program2.gp i have

set out `echo $file`

and launch gnuplot like this:

% file=\"graph.ps\" gnuplot program2.gp

a file `graph.ps' is written

----------------------------------------------------------------------

while it works, my method seems to me very kludgy... what i'd really
like in gp36 is a supported method to pass parameters values

% gnuplot -p soil=3 program1.gp

avoiding the soil=`echo $soil` in my programs

now that i'm daydreaming, if i had the above, i'd like also a
conditional assignment operator, to assign a default value to a
parameter if it is not set on the shell command line

thank you for your attention
                                                        gb

 
 
 

1. 'using' combined with running parameter

Hey,

I am trying to draw scatter plot (x/y) with the size of the
points/bubbles due to a third columns (z).
The following plot command does not work (gnuplot says undefined t).
Has anybody a better idea???

plot [t=0:2*pi] 'test gnu\foo2.txt' using (($1) +($3)*cos(t)):(($2)+($3)
*sin(t))

Best ragards,
Oliver

Sent via Deja.com http://www.deja.com/
Before you buy.

2. looking for tubes with grass blades.....

3. Passing 'Application.Icon' to a DLL

4. Set up failure 213

5. ********New Year's sale of programs*****New Year's sale of programs******************

6. Compression Codecs

7. motion study - showing body phases?