dofile("definitions.Quanty") G.Print({{"file","Spectra.dat"}}) gnuplotScript = gnuplotHead .. [[ set output "Spectra.ps" plot "Spectra.dat" using 1:(-$3 ) title 'T1' with lines ls 1,\ "Spectra.dat" using 1:(-$5+4) title 'T2' with lines ls 2,\ "Spectra.dat" using 1:(-$7+8) title 'T3' with lines ls 3 ]] file = io.open("Spectra.gnuplot", "w") file:write(gnuplotScript) file:close() -- call gnuplot to execute the script os.execute("gnuplot Spectra.gnuplot") os.execute("convert -density 1024 Spectra.ps -resize 1024 Spectra.png")