3 # growthplot -- plot the fetchmail project's growth as a function of time
6 PATH="$PATH:.:./dist-tools"; export PATH
8 tmp=/tmp/fetchmail-growthplot.$$
11 # Get data from the NEWS file
12 timeseries >$tmp/growthplot$$
13 grep "^[0-9]" $tmp/growthplot$$ >$tmp/growthnumbers$$
14 grep "^[0-9.]*.[05].0 " $tmp/growthplot$$ >$tmp/growthmajors$$
15 sed '/^4.2.9/,$d' <$tmp/growthnumbers$$ >$tmp/growthannounce$$
17 # gnuplot line styles. These occasionally change (like beteween 3.5 and 3.7);
18 # use "echo 'set terminal png; test' | gnuplot | display -" to check.
21 cyan_diamonds=37 # Once purple triangles, but we can't do that anymore
24 cat >$tmp/growthimage$$ <<EOF
25 set title "Fetchmail project growth history"
26 set xlabel 'Days since baseline'
27 set ylabel 'Participants'
28 set y2label 'Lines of code'
33 set y2range [5000:50000]
34 set key bottom right box
39 # OK, now write the event labels
44 while read version legend
46 if [ "$version" = '%' ]
48 echo "# Associate $lastday to '$legend'"
50 lastday=$(($lastday-5))
51 endy=$((breakheight+50+count*50))
54 # Label over curve hanging right, arrow down
55 arrowhead=$((lasttotal+50))
56 echo "set label '$legend' at $lastday-10, $endy+15"
58 # Label under curve hanging left, arrow up
59 arrowhead=$((lasttotal-5))
60 strlen=`python -c "print len('$legend')"`
62 echo "set label '$legend' at $lastday-$lablen+10, $endy-15"
65 from $lastday, $endy \
66 to $lastday, $arrowhead \
80 ) <$tmp/growthplot$$ >>$tmp/growthimage$$
82 # OK, now write the major-release labels
84 while read version size friends announce total days date
86 echo "set arrow from $days, $total - 55 to $days, $total - 15 head"
87 echo "set label '$version' at $days - 5, $total - 65"
89 ) <$tmp/growthmajors$$ >>$tmp/growthimage$$
91 cat >>$tmp/growthimage$$ <<EOF
92 plot [] [0:] '$tmp/growthnumbers$$' using 6:5 \
93 title "Both lists" with points $blue_boxes, \
94 '$tmp/growthannounce$$' using 6:4 \
95 title "fetchmail-announce" with points $cyan_diamonds, \
96 '$tmp/growthannounce$$' using 6:3 \
97 title "fetchmail-friends" with points $green_crosses, \
98 '$tmp/growthnumbers$$' using 6:2 axes x1y2 \
99 title "Lines of code" with points $brown_triangles
102 gnuplot $tmp/growthimage$$ >growth.png
107 # growthplot ends here