Wiki source for Blog20100929MageiaDonationFollowUp


Show raw source

There's some time I had not played with gnuplot

===Mageia donations curve (PayPal)===
http://download.tuxfamily.org/cooker/mageia/stats/MageiaDonation-date.png http://download.tuxfamily.org/cooker/mageia/stats/MageiaDonation-date_bezier.png

===enhancements===
http://t16web.lanl.gov/Kawano/gnuplot/plot2-e.html#5.8 ##smooth csplines##: strange, negative value appear :/ ; ##smooth bezier##: see above, not the same data is displayed :/

===gnuplot_donation.inc===
available at http://download.tuxfamily.org/cooker/mageia/stats/gnuplot_donation.inc
%%# gnuplot gnuplot_donation.inc
# B.Aud 2010-09-29
# input file is in csv, with separator ',' (as the name implies)
#"23/09/2010","00:44:57","EUR","50,00","-1,95","48,05","France"
# named gnuplot_donation.csv (generated by display_donation_mageia.sh
# known bugs^Wenhancements needed:
# - change color to blue
# - take into account decimals

set term png small


# x-axis is time
set xdata time

set timefmt "%d/%m/%Y %H:%M:%S"

set format x "%d/%m"

# ignore decimal as it comes from a csv
#set decimalsign ','

# could be enhanced if separator were ; :)
set datafile separator ','

#set xrange ["22/09/2010 00:00:00":"30/09/2010 00:00:00"]

#set missing 'NaN'

set out "MageiaDonation-date.png"

set title "Donations via PayPal to Mageia"

set xlabel "Days" rotate by 43
#set label x "Days" rotate


set ylabel "Amount"

set autoscale y

# use solid line blue
set style line 1 lt 1 lw 3

#plot 'gnuplot_donation.csv' using 1:7 notitle with lines # y 'smooth cumulative'
plot "<awk -F ',' '{i=i+$7; print $1,\",\",i}' gnuplot_donation.csv" using 1:2 notitle with lines # y 'smooth cumulative'

reset
%%

===display_donation.sh===
available at http://download.tuxfamily.org/cooker/mageia/stats/display_donations_mageia.sh
%%#! /bin/bash
# B.Aud 2010-09-29 GPL-3+
#
# http://t16web.lanl.gov/Kawano/gnuplot/datetime-e.html
# http://davbucci.chez-alice.fr/index.php?argument=matematica/gnuplot/gnuplot.inc
# http://stackoverflow.com/questions/1730913/gnuplot-cumulative-column-question

#"29/09/2010","20:06:21","EUR","10,00","-0,59","9,41","France"

# conversion d'iso-8859-15 à UTF-8,
# suppression première ligne,
# tri dans l'ordre chronologique
# format de date de "29/09/2010","20:06:21" à "29/09/2010 20:06:21"
# enlever les " (en perdant les chiffres après la virgule)
iconv --from-code=ISO-8859-15 --to-code=UTF-8 Mageia_donation.csv |tail --lines=+2 | sort | sed -e 's#2010","#2010 #g' -e 's#"##g' > gnuplot_donation.csv

#cat gnuplot_donation.csv
#exit
gnuplot gnuplot_donation.inc
eog MageiaDonation-date.png
%%

----
CategoryBlogMageia CategoryMageiaInfo CategoryMageiaDev
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki