Feature request: sub-second (double flout) precision for timefmt %s parsing (seconds since Unix epoch ) - as %S already does for second fields.
I often have sub second UNIX time stamp columns with numbers like "1390816308.582"
Currently 'set timefmt "%s"' takes only full seconds an strips the fractional digits.
The "%s" format already does what you ask. (See attached demo file).
I am guessing that whatever problem you are seeing comes at the stage of formatting the output, not the input.
(Also note that strictly speaking you don't need a time format to read in raw seconds/usecs. It's just a floating point number like any other x coordinate).
I tested your demo also. It allows the fractional digits in input file, but eats them as zero. See the output of your 'set table' demo. And when actually plotting, both in 'set term windows' and 'set term wxt', it shows the points snapped to full second positions, never at the real fractional positions.
Its on Windows, latest version 4.6.3 - fresh from sf.
When I provide data with a time stamp scheme like timefmt "...%H:%S" (...34:12.123) it works throughout with full resolution plots, but usually its inconvenient to provide such fidgety stringy formats.
--- usecs.bug
Warning: empty y range [1:1], adjusting to [0.99:1.01]
Curve 0 of 1, 6 points
Curve title: "'-' using 1:(1):2"
x y label type
"2014 Jan 27 19:56:47.000" 1 "A"
"2014 Jan 27 19:56:47.000" 1 "B"
"2014 Jan 27 19:56:47.000" 1 "C"
"2014 Jan 27 19:56:47.000" 1 "D"
"2014 Jan 27 19:56:48.000" 1 "E"
"2014 Jan 27 19:56:50.000" 1 "F"
--- usecs.bug data:
1390852607.1 A
1390852607.2 B
1390852607.4 C
1390852607.8 D
1390852608.4 E
1390852610.0 F
gnuplot> show ver
Another real word test data snippet:
1378829950.19 3688 3731 391 66 0 3705 3705 18116 9 773
1378829955.22 3700 3731 386 75 0 3702 3705 31139 8 775
1378829960.25 3705 3735 386 64 1 3710 3707 44159 8 776
Having something like set format x "%H:%M:S" then any combination of "set xdata time/unset xdata" and "set timefmt '%s'/unset timefmt" will either result in "Bad format character" or in snapping to full seconds. That doesn't work. (I also know from some past experiiment that gnuplot has a different time base from yr 2000 or so, not Unix epoch, inconveniently requiring extra math if it would work somehow).
Only "set format x" solves perhaps the fractionals problem, but then you have no time format display at all but an absurd big number - you can't discern sub digit position anyway then.
Last edit: kxroberto 2014-01-28
Aha. Thanks for showing the gnuplot version number.
Yes, I can reproduce your output in version 4.6.3 but the test script works correctly in version 4.6.4 and in current CVS.
And indeed, here is the relevant entry in ChangeLog:
2013-07-02
Anyhow, your entirely reasonably feature request has already been implemented and is in the current release version (4.6.4).
If you have any other requests/suggestions, feel free to add them.
Last edit: Ethan Merritt 2014-01-28
Thanks, I wait until the gp Windows version is up to 4.6.4
Re: use of floating point input together with time-format output
It depends on exactly what you are trying to plot. For many purposes the most convenient way to input fractional seconds and treat it as a full or partial date stamp is to use normal axis formats ("unset xdata") and filter the x coordinate values through strftime(x) to generate a string using time formats.
FWIW gnuplot's internal epoch has been changed to match the standard unix epoch in the development version. But that change will not appear in a release package until version 5.