blob: fa38171492a8922994b755c9370ab18b5519d0a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Gen#!/bin/sh
#
# growthplot -- plot the fetchmail project's growth as a function of time
#
# Get data from the NEWS file
timeseries >/tmp/growthplot$$
grep "^[0-9]" /tmp/growthplot$$ >/tmp/growthnumbers$$
grep "^[0-9.]*.[05].0 " /tmp/growthplot$$ >/tmp/growthmajors$$
sed '/^4.2.9/,$d' </tmp/growthnumbers$$ >/tmp/growthannounce$$
cat >/tmp/growthimage$$ <<EOF
set title "Fetchmail project growth history"
set xlabel 'Days since baseline'
set ylabel 'Participants'
set y2label 'Lines of code'
set ytics nomirror
set y2tics
set tics out
set autoscale y
set y2range [5000:50000]
set key bottom right box
set terminal png color
EOF
# OK, now write the event labels
(
count=0
lastday=0
breakheight=510
while read version legend
do
if [ "$version" = '%' ]
then
echo "# Associate $lastday to '$legend'"
count=$((count+1))
lastday=$(($lastday-5))
endy=$((breakheight+50+count*50))
if ((endy>lasttotal))
then
# Label over curve hanging right, arrow down
arrowhead=$((lasttotal+50))
echo "set label '$legend' at $lastday-10, $endy+15"
else
# Label under curve hanging left, arrow up
arrowhead=$((lasttotal-5))
strlen=`python -c "print len('$legend')"`
lablen=$((strlen*22))
echo "set label '$legend' at $lastday-$lablen+10, $endy-15"
fi
echo set arrow \
from $lastday, $endy \
to $lastday, $arrowhead \
head
else
set -- $legend
size=$1
friends=$2
announce=$3
total=$4
days=$5
date=$6
lastday=$days
lasttotal=$total
fi
done
) </tmp/growthplot$$ >>/tmp/growthimage$$
# OK, now write the major-release labels
(
while read version size friends announce total days date
do
echo "set arrow from $days, $total - 55 to $days, $total - 15 head"
echo "set label '$version' at $days - 5, $total - 65"
done
) </tmp/growthmajors$$ >>/tmp/growthimage$$
cat >>/tmp/growthimage$$ <<EOF
plot [] [0:] '/tmp/growthnumbers$$' using 6:5 \
title "Both lists" with points 3, \
'/tmp/growthannounce$$' using 6:4 \
title "fetchmail-announce" with points 5, \
'/tmp/growthannounce$$' using 6:3 \
title "fetchmail-friends" with points 2, \
'/tmp/growthnumbers$$' using 6:2 axes x1y2 \
title "Lines of code" with points 7
EOF
gnuplot /tmp/growthimage$$ >growth.png
rm -f /tmp/growth*
# growthplot ends here
|