Jump to content

File talk:Google Answers using Wikipedia.png

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

The code

[edit]
#!/bin/sh

TITLE="Google Answers using Wikipedia"
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' "${1:-googleanswers.dat}"  > ${TMP}

gnuplot <<_EOF_ || exit 1

# April 2002,      1
set timefmt '%B %Y'
set xdata time
set format x "%b\n%y"

set size .67,.5
set pointsize .5

set title "${TITLE}"
set xlabel " "
set ylabel "Answers"
set grid ytics noxtics
#set logscale y
#set yrange [0:100]

set terminal png color small
set output '${FILE}'


plot '${TMP}' using 1:3 title '' with lines \
        , '' using 1:3 title '' with points 3 \



_EOF_