From 11e644f58b1fd80b1955734a4a7a36883154f5c0 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 25 Feb 2001 17:56:30 +0000 Subject: Computations moved out of gnuplot into shell. svn path=/trunk/; revision=3146 --- growthplot | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/growthplot b/growthplot index a3deac79..000ddcab 100755 --- a/growthplot +++ b/growthplot @@ -26,25 +26,29 @@ EOF # OK, now write the event labels ( - echo "count=0" - echo "breakheight=510" + count=0 + lastday=0 + breakheight=510 while read version legend do if [ "$version" = '%' ] then echo "# Associate $lastday to '$legend'" - echo "count = count + 1" - echo "lastday = $lastday - 5" - echo "lasttotal = $lasttotal" - echo "endy = breakheight + 50 + count * 50" - echo "if (endy > lasttotal) arrowhead = lasttotal+50" - echo "if (endy <= lasttotal) arrowhead = lasttotal-5" + count=$((count+1)) + lastday=$(($lastday-5)) + endy=$((breakheight+50+count*50)) + if ((endy>lasttotal)) + then + arrowhead=$((lasttotal+50)) + echo "set label '$legend' at $lastday-10, $endy+15" + else + arrowhead=$((lasttotal-5)) + echo "set label '$legend' at $lastday-475, $endy-15" + fi echo set arrow \ - from lastday, endy \ - to lastday, arrowhead \ + from $lastday, $endy \ + to $lastday, $arrowhead \ head - echo "if (endy > lasttotal) set label '$legend' at lastday-10, endy+15" - echo "if (endy <= lasttotal) set label '$legend' at lastday-475, endy-15" else set -- $legend size=$1 -- cgit v1.2.3