File: scalegraph.sh

package info (click to toggle)
smlsharp 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 123,732 kB
  • sloc: ansic: 16,725; sh: 4,347; makefile: 2,191; java: 742; haskell: 493; ruby: 305; cpp: 284; pascal: 256; ml: 255; lisp: 141; asm: 97; sql: 74
file content (64 lines) | stat: -rw-r--r-- 1,393 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pointtype1=2
#pointtype2=4
#pointtype3=6
#pointtype4=8
#pointtype5=10
#pointtype6=12
: ${linecolor1:=plum}
: ${linecolor2:=web-green}
: ${linecolor3:=orange}
: ${linecolor4:=light-red}
: ${linecolor5:=grey50}
: ${linecolor6:=brown}
: ${linecolor7:=blue}
: ${linecolor8:=khaki}
: ${linewidth7:=8}
: ${xlabel='the number of workers'}
: ${ylabel='Speed-up'}
: ${bbox:='102 50 356 299'}
(
  cat <<-END
	set term postscript eps enhanced color font "Helvetica";
	set output "$1";
	set xlabel "$xlabel";
	set ylabel "$ylabel";
	set xrange [0.0:64.0];
	set yrange [0.0:64.0];
	set xlabel font "Helvetica,16";
	set ylabel font "Helvetica,16";
	set tics font "Helvetica,16";
	set key font "Helvetica,16";
	set xlabel offset 0,-0.2;
	set ylabel offset -0.4,0;
	set grid ytics;
	set size ratio 1.0;
	set key left top;
	set xtics 8;
	set ytics 8;
	plot \\
	END
  shift 1
  count=1
  while [ "$#" -gt 0 ]; do
    title=$1
    file=$2
    shift 2
    eval "pt=\$pointtype$count"
    eval "lw=\$linewidth$count"
    eval "lc=\$linecolor$count"
    count=$(($count+1))
    cat <<-END
	"$file" using(\$1):(\$2) with linespoints \\
	linetype 1 \\
	pointtype ${pt:-5} \\
	linewidth ${lw:-5} \\
	linecolor rgb "${lc:-black}"\\
	pointsize 1.5 \\
	title "$title", \\
	END
  done
  cat <<-END
	x dashtype 2 linecolor rgb "black" notitle
	END
) | gnuplot
sed -i.orig "/^%%BoundingBox/s/.*/%%BoundingBox: $bbox/" "$1"