On 17/06/13 00:40, Anthony Anson wrote:
12.45 - 149/83 + 152 bpm
13.45 - 128/85 + 131 bpm
14.45 - 127/80 + 148 bpm
15.45 - 185/105 + 144 bpm
I've been trying to work out how to do this with Gnuplot, as a mental exercise! I re-entered that data above into a file I called test3.dat
#Date Time High Low BPM 17/6/2013 12:45 149 83 152 17/6/2013 13:45 128 85 131 17/6/2013 14:45 127 80 148 17/6/2013 15:45 185 105 144
NB that's space separated.
I obviously installed gnuplot, but then I installed gnuplot-qt. This caused gnuplot-nox to be uninstalled. I don't know if I needed to do this, but before I did it, I didn't know how to get output to appear on screen.
I moved to the directory that file test3.dat was in, & started GnuPlot, then typed
set xdata time set timefmt "%d/%m/%Y %H:%M" plot 'test3.dat' using 1:3 with linespoints title 'High', 'test3.dat' using 1:4 with linespoints title 'Low', 'test3.dat' using 1:5 with linespoints title 'BPM'
What this does is 1) sets the x axis to be showing dates & times
Sets the format of the time column(s) in the data file to be the format you are using. In this case days (0-31), months (0-12), years (4 digits), a space, then Hours (24 clock format - 00-23), Minutes (00-59).
Gnuplot considers date/time to take up 2 columns with the format above.
The plot line plots data in file "test3.dat" using columns 1 (date&time), and 3 - high bp, and labels it High. It then plots the data in file "test3.dat" (the same file) using columns 1 (date & time) and column 4 and labels it "low".
It then plots data in file using columns 1 and column 5 which it labels BP.
I'm sure it'll be possible to convince gnuplot to use different format data. Use help timefmt to look at possible values to put in the set timefmt command. If you have commas between columns, you can use set datafile sep ','
I think the thing is you'll need consistency - e.g. always have space or comma separated columns.
Actually, I just changed the data so that it was in the format #Date Time High Low BPM 17/6/2013 12:45 149 83 - 152 BPM ...
and changed the final plot to 'test3.dat' using 1:6 and it worked.
Obviously you'll have to ensure that if you're graphing over separate days, that you have the date in the data and not just the time.
Hope that helps!
Steve