Monday, December 31, 2012

Plotting a weight loss curve from CanOfSleep's WWDiary app

I've been using the Android app WWDiary published by CanOfSleep.com as a food / weight diary. And it works! ... for me anyhow. Another few kg to go and I should be at my goal early in 2013. It's always encouraging to see your long term progress plotted visually. Unfortunately this app has no plotting capability so I wrote a short GnuPlot script to do this.
I manually transcribed the values from the weight diary into file 'weight.dat' with a format that looks like this:


20121226 74.0
20121227 74.6
20121228 73.4
20121229 73.1
20121230 74.1
20121231 74.9

And the following GnuPlot script generates the above chart:

set xdata time
set timefmt "%Y%m%d"
set format x "%d/%m"
set title "Weight loss curve 2012"
set xlabel "Time"
set ylabel "Mass (kg)"
set term png size 800,400
set output "weight.png"
plot 'weight.dat' using 1:2 with linespoints

Updates:

10 June 2014: I've got an updated howto on doing this which includes extracting the data automatically from the wwdiary database file. See http://jdesbonnet.blogspot.ie/2014/06/weight-charts-from-wwdiary-part-1.html

No comments: