From 1a71a48e89eba1817096997f73b6a8fd05dba3ee Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Sun, 29 Jan 2012 20:37:29 +0100 Subject: [PATCH] improve parsing --- prefix/.gnuplot | 5 ----- prefix/parseDat.py | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 prefix/.gnuplot diff --git a/prefix/.gnuplot b/prefix/.gnuplot deleted file mode 100644 index 77454ed..0000000 --- a/prefix/.gnuplot +++ /dev/null @@ -1,5 +0,0 @@ -set terminal png font arial 8 #size 600,300 -set grid -set xlabel 'Numbers calculated' -set ylabel 'Time needed for calculation' -set datafile separator ';' diff --git a/prefix/parseDat.py b/prefix/parseDat.py index d6d0d90..e4d260d 100755 --- a/prefix/parseDat.py +++ b/prefix/parseDat.py @@ -8,14 +8,19 @@ def listtofile(listing, file): fd.write(i+"\n") fd.close() -def makeGraphs(graphs, graphtitle): +def makeGraphs(graphs, graphtitle = "Title", xlabel = "Numbers calculated", ylabel = "Time needed for calculation"): gendir = "stats/generated/" subprocess.call(["mkdir", "-p", gendir]) p = subprocess.Popen(['gnuplot'],stdout=subprocess.PIPE,stdin=subprocess.PIPE) # now do the plots for graphfile in graphs: # set output 'filename' + p.stdin.write("set terminal png font arial 8 #size 600,300\n") + p.stdin.write("set grid\n") + p.stdin.write("set datafile separator ';'\n") p.stdin.write("set title 'Timing of each "+graphtitle+"'\n") + p.stdin.write("set xlabel '"+xlabel+"'\n") + p.stdin.write("set ylabel '"+ylabel+"'\n") p.stdin.write("set output '"+gendir+graphfile+"'\n") # plot 'filename' using 1:2 title 'algorithm' with lines, 'filename2' using 1:2 title 'algo2' with lines plots = [] -- 2.43.0