From e7e69f3b225aba39e4986030ce25805b436d754c Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Thu, 4 Sep 2008 22:12:11 -0400 Subject: support lines and linespoints in plot_scatter --- plot_scatter | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) (limited to 'plot_scatter') diff --git a/plot_scatter b/plot_scatter index c92c11a..1a455c5 100755 --- a/plot_scatter +++ b/plot_scatter @@ -5,14 +5,31 @@ # try thinner lines NICE="blacktext linewidth 1.0 \"Helvetica\" 16 " -if [ "$1" == "--eps" ]; then - EXT="eps" - TERMINAL="postscript color eps $NICE" - shift -else - EXT="png" - TERMINAL="png picsize 1024 768" -fi +EXT="png" +TERMINAL="png picsize 1024 768" + +GRAPH=points + +while true; do + case $1 in + --eps) + shift + EXT="eps" + TERMINAL="postscript color eps $NICE" + ;; + --lines) + shift + GRAPH=lines + ;; + --linespoints) + shift + GRAPH=linespoints + ;; + *) + break + ;; + esac +done OUT=$1 @@ -29,11 +46,13 @@ while [ ! -z "$1" ] && [ ! -z "$2" ] && [ ! -z "$3" ] && [ ! -z "$4" ]; do COL1=$2 COL2=$3 NAME=$4 - PLOT="$PLOT '${CSV}' using ${COL1}:${COL2} title '${NAME}' with points" + PLOT="$PLOT '${CSV}' using ${COL1}:${COL2} title '${NAME}' with $GRAPH" shift 4 if [ ! -z "$1" ]; then PLOT="$PLOT, " fi + # fixup csv file, gnuplot is picky + sed -i -e 's/,\([^ ]\)/, \1/g' "$CSV" done #echo $OUT @@ -50,9 +69,6 @@ fi OUT="${OUT}.${EXT}" -# fixup csv file, gnuplot is picky -#sed -i -e 's/,\([^ ]\)/, \1/g' $CSV1 - gnuplot <