From Wikipedia, the free encyclopedia
[edit] The code
#!/bin/sh
TITLE="Daily page requests for wikipedia.org"
YLABEL="Avg. daily page requests (millions)"
FILE=`echo "$TITLE" | sed 's/\ /_/g'`.png
#--
TMP="_gpdata_$$"
trap "/bin/rm -f ${TMP} ; exit" 0
sed 's/^[ ]*//
s/,/ /g
s/Jan /January /
s/Feb /February /
s/Mar /March /
s/Apr /April /
s/Jun /June /
s/Jul /July /
s/Aug /August /
s/Sep /September /
s/Oct /October /
s/Nov /November /
s/Dec /December /
s/[ ][ ]*/ /g
/^[ ]*$/d' $@ > ${TMP}
gnuplot <<_EOF_ || exit 1
# April 2002, 1, 3
set timefmt '%B %Y'
set xdata time
set format x "%b\n%y"
set size .67,.67
set title "${TITLE}"
set xlabel " "
set ylabel "${YLABEL}"
set grid ytics noxtics
set logscale y
#set yrange [0:100]
set terminal png color small
set output '${FILE}'
set key left
plot '${TMP}' using 1:(\$4/1000000) title '' with lines 1 \
, '' using 1:(\$4/1000000) title 'All languages' with points 3 \
, '' using 1:(\$3/1000000) title '' with lines 1 \
, '' using 1:(\$3/1000000) title 'English' with points 11 \
_EOF_