From: Thomas S. <t.s...@fz...> - 2012-05-21 09:07:36
|
use one 'plot' command and add the individual plots without line feed and leading comma: #!/bin/bash scriptfile="my_plot.gps" # we want a fresh script file rm -f $scriptfile echo 'set terminal jpeg' >> $scriptfile echo 'set output "all_plots.jpg"' >> $scriptfile # one plot command only echo -n 'plot' >> $scriptfile # the first plot is undefined. thus we start the real # plots with the second plot and can use a leading "," # all the time. echo -n ' 0/0' >> $scriptfile # iterate over *.dat files for i in *.dat do echo -n ",'$i' u 1:2 w l title 'data from $i'" >> $scriptfile done #call gnuplot gnuplot $scriptfile # delete temporary file rm $scriptfile Darkknight85 wrote: > > Hi i want to plot all the files .dat in my folder in one only graph, such > as (plot "file1.dat" using 1:2 with lines, "file2.dat" using 1:2 and so > on....), i've found this ubuntu's script: > > # write a gnuplot script > echo 'set terminal jpeg' >> my_plot.gps > > # iterate over .txt files > for i in *.dat > do > # create appropriate name for resulting image > filename=`echo $i | sed 's/dat/jpg/'` > > # add seperate plots for each file > echo "set output '$filename'" >> my_plot.gps > echo "plot '$i' u 1:2 w l title 'data from $i'" >> my_plot.gps > echo "reset" >> my_plot.gps > done > > # call gnuplot > gnuplot my_plot.gps > > # delete temporary file > rm my_plot.gps > > Ok, but if i want a script that paint all files .dat in one only graph?( > -- View this message in context: http://old.nabble.com/Plot-all-files-in-one-only-graph.-tp33869595p33881456.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |