#1067 Binary files with time data won't print (v4.4)

2D plot (258)

Time formatted data ought to work with binary I/O but doesn't appear to. In the 4.4 reference manual, the description of binary files indicates that columns are treated the same as for ASCII files. Hence, with the "%s" time format I should be able to plot binary data containing UNIX timestamps. But

set timefmt "%s"
set xdata time
plot '-' binary record=(5) format=%double%double using 1:2 notitle with points

(followed by a 2x5 collection of doubles with first column ranging from 0-1e7 and second column ranging from 0-10) ought to produce a plot over the first four months of 1970. Instead it fails with "warning: Skipping data file with no valid points", followed by "all points y value undefined!" Doing the same plot with the same data, but without the "set timefmt" and "set xdata time" commands produces a valid plot.

What am I missing here? This appears to be either a bug in the time format interpretation code, or a bug in the documentation about the binary format.


  • Craig DeForest

    Craig DeForest - 2011-12-01

    Binary file containing a 2x5 array of doubles in little-endian format. First column contains (1,2,4,6,8)x10^6, second column contains (20,10,5,15,2).

  • Craig DeForest

    Craig DeForest - 2011-12-01

    (This is under MacOS 10.6.8, gnuplot 4.4)

  • Ethan Merritt

    Ethan Merritt - 2011-12-02

    Sorry. Can't reproduce the problem.
    The datafile you attached plots fine in both 4.4.4 (current) and 4.5 (cvs) using the commands

    gnuplot> set xdata time
    gnuplot> plot 'bdata' binary record=(5) format="%double%double" using 1:2 notitle with points

    The command "set timefmt" is irrelevant in this case because the data isn't formatted, it's binary. You can set it if you like, but it doesn't do anything.

    I do notice that the command you list in the bug report is missing quotes around the format. Could that be the source of your problem?

  • Ethan Merritt

    Ethan Merritt - 2011-12-02
    • status: open --> open-works-for-me
  • Craig DeForest

    Craig DeForest - 2011-12-02

    My bad on the quotes around the format statement -- mistyped the ilne into the tracker, I suppose.

    I confirmed it on 4.4, patchlevel 0 on MacOS X and Fedora Linux x64. The I just updated the former with fink and latter was freshly installed from yum, so I guess this is a matter of older versions still kicking around in the various repositories. Thanks for checking.

  • Ethan Merritt

    Ethan Merritt - 2011-12-06
    • status: open-works-for-me --> closed-works-for-me

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks