aboutsummaryrefslogtreecommitdiffstats
path: root/growthplot
blob: b476817c9ab6e710c0d5dc6b02a156a34b9ca7da (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
63
64
65
66
#!/bin/sh
#
# growthplot -- plot the fetchmail population's growth as a function of time
#

# Get data from the NEWS file
timeseries >/tmp/growthplot$$
grep "^[0-9]" /tmp/growthplot$$ >/tmp/growthnumbers$$
sed '/^4.2.9/,$d' </tmp/growthnumbers$$ >/tmp/growthannounce$$

cat >/tmp/growthimage$$ <<EOF
set title "Fetchmail project growth history"
set xlabel 'Days since project start'
set ylabel 'Participants' 6	# Put it right over the Y axis
set key bottom right box

EOF

# OK, now write the event labels
(
	echo "count=0"
	echo "breakheight=510"
	while read version friends announce total days date
	do
		if [ "$version" = '%' ]
		then
			legend="$friends $announce $total $days $date"
			echo "# Associate $lastday to '$legend'"
			echo "count = count + 1"
			echo "lastday = $lastday - 5"
			echo "lasttotal = $lasttotal"
			echo set arrow \
				from lastday, breakheight \
				to lastday, lasttotal+50 \
				head
			echo "endx = lastday + 50 + count * 25"
			echo "endy = breakheight + 50 + count * 50"
			echo "set arrow \
				from lastday, breakheight to endx, endy nohead"
			echo "set label '$legend' at endx+10, endy"
		else
			lastday=$days
			lasttotal=$total
		fi
	done
) </tmp/growthplot$$ >>/tmp/growthimage$$

cat >>/tmp/growthimage$$ <<EOF
# First, plot total participants
plot [] [0:] '/tmp/growthnumbers$$' using 5:4 \
		title "Both lists" with points 3

# Then, plot announce-list only starting from the Julian date of the split
replot '/tmp/growthannounce$$' using 5:3 \
		title "fetchmail-announce" with points 4

# Finally, plot the developer list
replot '/tmp/growthannounce$$' using 5:2 \
		title "fetchmail-friends" with points 2
EOF

echo "pause 9999" >>/tmp/growthimage$$

gnuplot /tmp/growthimage$$

rm -f /tmp/growth*