Friday, April 11, 2008

GNUPlot for the data logger files

A few people have asked how I do my graphs in the datalogger project.

I use gnuplot via the following script i call 'makeplots.sh'

#!/bin/sh
for file
do
gnuplot << EOF
set terminal png size 1024,768
set output "$file.png"
set origin 0,0
plot "$file.txt" u 3 w i t 'light' axes x1y2 2, "$file.txt" u 9 w l t 'Temperature' 1
EOF
open $file.png
done


I capture the output from the logger using a terminal program and save it as "data.txt"
I then call 'makeplots.sh data.txt" and I'm done.

I run this on a Mac with osX 10.5 ( it also worked in older versions as well)

0 Comments:

Post a Comment

<< Home