diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-02-22 00:41:36 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-02-22 00:41:36 -0500 |
commit | be610af3ec405f0dbaa4eec3bf94905268b8b392 (patch) | |
tree | a1cbe6dc1fe12cfce68254d1a969e4ff5df8cc36 /plot_scatter | |
parent | 65fa321d63cfd3a38309b7ec8907df5c4a8d26b6 (diff) |
remove old bash cruft
Diffstat (limited to 'plot_scatter')
-rwxr-xr-x | plot_scatter | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/plot_scatter b/plot_scatter deleted file mode 100755 index de709f3..0000000 --- a/plot_scatter +++ /dev/null | |||
@@ -1,125 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | #NICE="blacktext linewidth 4.0 \"Helvetica\" 16 " | ||
4 | |||
5 | # try thinner lines | ||
6 | NICE="color blacktext solid linewidth 1.0 \"Helvetica\" 20 size 16cm,7cm" | ||
7 | |||
8 | EXT="png" | ||
9 | TERMINAL="png size 1024,768 large" | ||
10 | |||
11 | GRAPH=points | ||
12 | XTRA= | ||
13 | while true; do | ||
14 | case $1 in | ||
15 | --eps) | ||
16 | shift | ||
17 | EXT="eps" | ||
18 | TERMINAL="postscript eps $NICE" | ||
19 | ;; | ||
20 | --lines) | ||
21 | shift | ||
22 | GRAPH=lines | ||
23 | ;; | ||
24 | --xrange) | ||
25 | shift | ||
26 | XRANGE="set xrange [$1:$2]" | ||
27 | shift | ||
28 | shift | ||
29 | ;; | ||
30 | --xticks) | ||
31 | shift | ||
32 | XTICKS="set xtics $1, $2" | ||
33 | shift | ||
34 | shift | ||
35 | ;; | ||
36 | --yrange) | ||
37 | shift | ||
38 | YRANGE="set yrange [$1:$2]" | ||
39 | shift | ||
40 | shift | ||
41 | ;; | ||
42 | --yticks) | ||
43 | shift | ||
44 | YTICKS="set ytics $1, $2" | ||
45 | shift | ||
46 | shift | ||
47 | ;; | ||
48 | --extra) | ||
49 | shift | ||
50 | XTRA="$1" | ||
51 | ;; | ||
52 | --linespoints) | ||
53 | shift | ||
54 | GRAPH=linespoints | ||
55 | ;; | ||
56 | --*) | ||
57 | echo "unrecognized option: $1" | ||
58 | exit 1 | ||
59 | ;; | ||
60 | *) | ||
61 | break | ||
62 | ;; | ||
63 | esac | ||
64 | done | ||
65 | |||
66 | |||
67 | OUT=$1 | ||
68 | XLABEL=$2 | ||
69 | YLABEL=$3 | ||
70 | TITLE=$4 | ||
71 | shift 4 | ||
72 | |||
73 | PLOT="plot " | ||
74 | |||
75 | |||
76 | while [ ! -z "$1" ] && [ ! -z "$2" ] && [ ! -z "$3" ] && [ ! -z "$4" ]; do | ||
77 | CSV=$1 | ||
78 | COL1=$2 | ||
79 | COL2=$3 | ||
80 | NAME=$4 | ||
81 | PLOT="$PLOT '${CSV}' using ${COL1}:${COL2} title '${NAME}' with $GRAPH" | ||
82 | shift 4 | ||
83 | if [ ! -z "$1" ]; then | ||
84 | PLOT="$PLOT, " | ||
85 | fi | ||
86 | # fixup csv file, gnuplot is picky | ||
87 | sed -i -e 's/,\([^ ]\)/, \1/g' "$CSV" | ||
88 | done | ||
89 | |||
90 | #echo $OUT | ||
91 | #echo $XLABEL | ||
92 | #echo $YLABEL | ||
93 | #echo $TITLE | ||
94 | #echo $PLOT | ||
95 | |||
96 | if [ "$PLOT" = "plot " ]; then | ||
97 | echo "Usage: $0 [--eps] <outfile> <X label> <Y label> <title> "\ | ||
98 | "(<csv file> <column1> <column2> <label>)+" | ||
99 | exit 1 | ||
100 | fi | ||
101 | |||
102 | OUT="${OUT}.${EXT}" | ||
103 | KEY="set key below" | ||
104 | KEY="set key off" | ||
105 | gnuplot <<EOM | ||
106 | set terminal $TERMINAL | ||
107 | set out '/dev/null' | ||
108 | $YRANGE | ||
109 | $YTICKS | ||
110 | $XRANGE | ||
111 | $XTICKS | ||
112 | $PLOT | ||
113 | set ylabel '$YLABEL' | ||
114 | set xlabel '$XLABEL' | ||
115 | set title '$TITLE' | ||
116 | $KEY | ||
117 | set data style $GRAPH | ||
118 | set out '$OUT' | ||
119 | replot | ||
120 | set out | ||
121 | EOM | ||
122 | |||
123 | if [ "$EXT" == "eps" ]; then | ||
124 | ps2pdf -dEPSCrop $OUT | ||
125 | fi | ||