Question

I have this chart of data in a "datafile" :

2014/04/03 07:06:00.000   48.377951310
2014/04/03 07:06:00.200   48.377951362
2014/04/03 07:06:00.400   48.377951672
2014/04/03 07:06:00.600   48.377951883
2014/04/03 07:06:00.800   48.377952354
2014/04/03 07:06:01.000   48.377952750
2014/04/03 07:06:01.200   48.377952887
2014/04/03 07:06:01.400   48.377953223
2014/04/03 07:06:01.600   48.377953539
2014/04/03 07:06:01.800   48.377953377
2014/04/03 07:06:02.000   48.377953545

And I ask gnuplot this

set xdata time
set timefmt '%Y/%m/%d %H:%M:%S'
plot datafile using 1:2 with point

But I obtain a "flat" graph, every point have Y = 7, while the X goes from 06:00 to 06:20

The column of hours (7) is read as the 2nd column, the column of minutes:seconds as the first, and the column of the date is not interpreted ...

How to read correctly the file, in order to get a (simple) graph of data in function of time ?

Thanks !

Was it helpful?

Solution

You must plot the third vs. the first column:

set xdata time
set timefmt '%Y/%m/%d %H:%M:%S'
plot datafile using 1:3 with point

At the moment I can't give you a proper explanation. I guess that gnuplot reads in all columns independent of some timefmt settings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top