Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnuplot alternative with higher time precision

At present I'm using gnuplot to plot data against a time line. However the precision of the time line is in milliseconds but gnuplot only seems to be able to handle seconds.

I've looked at a couple of alternatives, but really I just need something like gnuplot that can cope with fractions of a second.

The programming language used for the main script is Python and whilst I've looked at matplotlib, it seems to be a lot more 'heavy duty' than gnuplot. As I won't always be the one updating the graphing side of things, I want to keep it as easy as possible.

Any suggestions?

Update

I'm using this with gnuplot:

set xdata time
set timefmt "%Y-%m-%d-%H:%M:%S"

However there is no %f to get milliseconds. For example, this works:

2011-01-01-09:00:01

but I need:

2011-01-01-09:00:01.123456
like image 499
PeterM Avatar asked Jan 25 '11 04:01

PeterM


1 Answers

According to the gnuplot 4.6 manual it states, under "Time/date specifiers" (page 114 of the gnuplot 4.6 PDF):

%S - second, integer 0–60 on output, (double) on input

What this means is that when reading timestamps such as 2013-09-16 09:56:59.412 the fractional portion will be included as part of the %S specifier. Such a timestamp will be handled correctly with:

set timefmt "%Y-%m-%d %H:%M:%S"
set datafile separator ","
plot "timed_results.data" using 1:2 title 'Results' with lines

and fed with data like:

2013-09-16 09:56:53.405,10.947
2013-09-16 09:56:54.392,10.827
2013-09-16 09:56:55.400,10.589
2013-09-16 09:56:56.394,9.913
2013-09-16 09:56:58.050,11.04
like image 54
PP. Avatar answered Oct 30 '22 01:10

PP.