Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

parameter file

10 views
Skip to first unread message

zet...@gmail.com

unread,
Oct 30, 2012, 5:28:39 PM10/30/12
to
I've got two files. One has the data and the other has some parameters
describung the data:

data.txt
134
156
112
...

param.csv
"Title";-10;10;s;0;200;kg

I would like to include these values to e.g. title, xmin, xmax, xunit,
ymin, ymax and yunit for further calculations in the plot.

Is this possible? Where should I start reading? Are there any examples?

Thanks!

Alex van der Spek

unread,
Nov 3, 2012, 10:52:05 AM11/3/12
to
Use 'load "param.txt"' to load your parameters. The "param.txt' file is:

Title = 'Title'
xmin = -10
xmax = 10
xunit = 'kg'

Then call your plotscript 'foo.plt'.

call 'foo.plot' 'param.txt' 'data.txt'

with the plotscript something like:

load '$0'

set title Title
set xrange [xmin:xmax]
set xlabel xunit
plot '$1' using 1:2 with linespoints


The load loads your parameter file. Everthing in there should be normal
gnuplot commands or declarations of parameters or functions. The call runs
the script using 2 command line parameters which are substituted in the
script as $0 and $1.

Good luck,
Alex van der Spek




<zet...@gmail.com> wrote in message news:87y5in8...@kerstf.org...

zet...@gmail.com

unread,
Nov 3, 2012, 2:06:43 PM11/3/12
to
> The load loads your parameter file. Everthing in there should be
> normal gnuplot commands or declarations of parameters or
> functions. The call runs the script using 2 command line parameters
> which are substituted in the script as $0 and $1.

In the meantime I have choosen another path. I generated the whole
Gnuplot file with a shell script. The splitting is done with `awk -F\;
"{print...}"' and every parameter generates a new variable. Then Gnuplot
can do all the calculations necessary for the plot. Works like a charm.

Thank you for your suggestions anyway and all the people contributing to
Gnuplot. It's a wonderful project!

--
zetras
while(!(success=try()));
0 new messages