« Return to Thread: source filename as parameter

Re: source filename as parameter

by Dr. Ing. Dieter Jurzitza :: Rate this Message:

Reply to Author | View in Thread

Hi Carlo,
you cannot provide the data filename on the commandline because it contains no
information what to do.
However, you can have a set of scripts (or a sequence of scripts or
whatever ...)
you call

gnuplot <myscript1>

where
<myscript1>
is any ascii file containing formatting information and the file you want to
plot from. Say you want to plot the first column of "mydata.dat" vs. the
second column of "mydata.dat" you would create a file, say "mydata.plt" that
contains

*********************
plot "mydata.dat" using 1:2 w l lw 2
*********************

(just for example)

If you are on linux (or unix) you could write

*********************
#!/usr/bin/gnuplot
plot "mydata.dat" using 1:2 w l lw 2
*********************

into mydata.plt, make this file executable (chmod 0755 mydata.plt) and call
it - the only thing you have to make sure is that the path to gnuplot fits
your situation.
Hope this helps,
take care



Dieter Jurzitza


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

                               |
                                \
                 /\_/\           |
                | ~x~ |/-----\   /
                 \   /-       \_/
  ^^__   _        /  _  ____   /
 <°°__ \- \_/     |  |/    |  |
  ||  ||         _| _|    _| _|

if you really want to see the pictures above - use some font
with constant spacing like courier! :-)
-----------------------------------------------------------Am Sonntag, 28.
Dezember 2008 23:24:39 schrieb CarloG:
> My main purpose is to exploit as data source a different file each time I
> invoke gnuplot from a script.
>
> I would like to provide the source file name as a parameter.
*****

------------------------------------------------------------------------------
_______________________________________________
Gnuplot-info mailing list
Gnuplot-info@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-info

 « Return to Thread: source filename as parameter