aboutsummaryrefslogtreecommitdiffstats
path: root/plot_scatter
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2009-02-22 00:41:36 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2009-02-22 00:41:36 -0500
commitbe610af3ec405f0dbaa4eec3bf94905268b8b392 (patch)
treea1cbe6dc1fe12cfce68254d1a969e4ff5df8cc36 /plot_scatter
parent65fa321d63cfd3a38309b7ec8907df5c4a8d26b6 (diff)
remove old bash cruft
Diffstat (limited to 'plot_scatter')
-rwxr-xr-xplot_scatter125
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
6NICE="color blacktext solid linewidth 1.0 \"Helvetica\" 20 size 16cm,7cm"
7
8EXT="png"
9TERMINAL="png size 1024,768 large"
10
11GRAPH=points
12XTRA=
13while 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
64done
65
66
67OUT=$1
68XLABEL=$2
69YLABEL=$3
70TITLE=$4
71shift 4
72
73PLOT="plot "
74
75
76while [ ! -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"
88done
89
90#echo $OUT
91#echo $XLABEL
92#echo $YLABEL
93#echo $TITLE
94#echo $PLOT
95
96if [ "$PLOT" = "plot " ]; then
97 echo "Usage: $0 [--eps] <outfile> <X label> <Y label> <title> "\
98 "(<csv file> <column1> <column2> <label>)+"
99 exit 1
100fi
101
102OUT="${OUT}.${EXT}"
103KEY="set key below"
104KEY="set key off"
105gnuplot <<EOM
106set terminal $TERMINAL
107set out '/dev/null'
108$YRANGE
109$YTICKS
110$XRANGE
111$XTICKS
112$PLOT
113set ylabel '$YLABEL'
114set xlabel '$XLABEL'
115set title '$TITLE'
116$KEY
117set data style $GRAPH
118set out '$OUT'
119replot
120set out
121EOM
122
123if [ "$EXT" == "eps" ]; then
124 ps2pdf -dEPSCrop $OUT
125fi