3 # growthplot -- plot the fetchmail project's growth as a function of time
6 # Get data from the NEWS file
7 timeseries >/tmp/growthplot$$
8 grep "^[0-9]" /tmp/growthplot$$ >/tmp/growthnumbers$$
9 grep "^[0-9.]*.[05].0 " /tmp/growthplot$$ >/tmp/growthmajors$$
10 sed '/^4.2.9/,$d' </tmp/growthnumbers$$ >/tmp/growthannounce$$
12 # gnuplot line styles. These occasionally change (like beteween 3.5 and 3.7);
13 # use "echo "set terminal png color; test" | gnuplot | display - to check.
16 cyan_diamonds=37 # Once purple triangles, but we can't do that anymore
19 cat >/tmp/growthimage$$ <<EOF
20 set title "Fetchmail project growth history"
21 set xlabel 'Days since baseline'
22 set ylabel 'Participants'
23 set y2label 'Lines of code'
28 set y2range [5000:50000]
29 set key bottom right box
30 set terminal png color
34 # OK, now write the event labels
39 while read version legend
41 if [ "$version" = '%' ]
43 echo "# Associate $lastday to '$legend'"
45 lastday=$(($lastday-5))
46 endy=$((breakheight+50+count*50))
49 # Label over curve hanging right, arrow down
50 arrowhead=$((lasttotal+50))
51 echo "set label '$legend' at $lastday-10, $endy+15"
53 # Label under curve hanging left, arrow up
54 arrowhead=$((lasttotal-5))
55 strlen=`python -c "print len('$legend')"`
57 echo "set label '$legend' at $lastday-$lablen+10, $endy-15"
60 from $lastday, $endy \
61 to $lastday, $arrowhead \
75 ) </tmp/growthplot$$ >>/tmp/growthimage$$
77 # OK, now write the major-release labels
79 while read version size friends announce total days date
81 echo "set arrow from $days, $total - 55 to $days, $total - 15 head"
82 echo "set label '$version' at $days - 5, $total - 65"
84 ) </tmp/growthmajors$$ >>/tmp/growthimage$$
86 cat >>/tmp/growthimage$$ <<EOF
87 plot [] [0:] '/tmp/growthnumbers$$' using 6:5 \
88 title "Both lists" with points $blue_boxes, \
89 '/tmp/growthannounce$$' using 6:4 \
90 title "fetchmail-announce" with points $cyan_diamonds, \
91 '/tmp/growthannounce$$' using 6:3 \
92 title "fetchmail-friends" with points $green_crosses, \
93 '/tmp/growthnumbers$$' using 6:2 axes x1y2 \
94 title "Lines of code" with points $brown_triangles
97 gnuplot /tmp/growthimage$$ >growth.png
101 # growthplot ends here