From: SB <ste...@gm...> - 2006-12-11 11:01:06
|
Hello Philipp, I had a similar problem and used a slightly different way than Bernard suggested. It is not as elegant but there are advanced possibilities. I wrote a script that first creates a gnuplot-script-file (plotfile.gnu) and then calles gnuplot to open it. The gnuplot-script-file will look exactly like the one you asked for, with one extra line (save "diagramm.gnu") at the end. The script for your problem could look similar to the following one: #!/bin/sh #Step 1: create file echo set title $1 > plotfile.gnu echo plot $1.data using (\$16 * 8):20 with linespoints notitle >>plotfile.gnu echo pause -1 >>plotfile.gnu echo save \"diagramm.gnu\" #Step 2: call gnuplot gnuplot plotfile.gnu When you see the plot, gnuplot is in interactive mode and you can therefore zoom in and out, turn on/off logscale and so on. If you liked the plot, rename the file "diagramm,gnu" and you have it saved with the last settings for zoom and so on. By the way, you can also teach KDE/Gnome/... to open your .data-files by click with a script like this. You need to modify the script that it accepts the complete filename. Then set the file associations of KDE/Gnome/... to open .data-files with this script. Then you just click on your .data file in the file-browser and have it displayed directly. I hope, this can be useful for you, Schöne Grüße, Stephan Am Freitag, den 08.12.2006, 14:45 +0100 schrieb Philipp Fechteler: > Hello > > Is it possible to pass arguments to a Gnuplot script (in Linux on the > command line), e.g. a file name for a data file. I would like to do the > following kind of script: > > #! /usr/bin/gnuplot > set title ARGV[1] > plot ARGV[1].data using ($16 * 8):20 with linespoints notitle > pause -1 > > This script should generate a plot with the title given as first command > line argument, an with the graph constructed from the first command line > argument added with the suffix .data. > > Best regards > Philipp > > ________________________________________________________________________ > Dipl.-Ing. Philipp Fechteler > Department Image Processing > Fraunhofer Institute for Telecommunications > Heinrich-Hertz-Institut (HHI) > Einsteinufer 37 > 10587 Berlin, Germany > Phone +49 30 31002 616 > Fax +49 30 31002 200 > Email phi...@hh... > WWW http://iphome.hhi.de/fechteler > ________________________________________________________________________ > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Gnuplot-info mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info |