'binary' and 'time/date' somehow don't work together,
gnuplot still expects the date as a string in 'binary' mode.
this somehow doesn't make sense...
if you want to compile your own special version of gnuplot
try the following patch:
> diff -u src/datafile.c.orig src/datafile.c
--- src/datafile.c.orig 2009-10-24 11:14:18.000000000 +0200
+++ src/datafile.c 2009-10-24 11:30:18.000000000 +0200
@@ -4539,20 +4539,15 @@
struct tm tm;
if (column > df_no_cols
- || df_column[column - 1].good == DF_MISSING
- || !df_column[column - 1].position
- || !gstrptime(df_column[column - 1].position,
- axis_array[df_axis[output]].timefmt,
- &tm)) {
+ || df_column[column - 1].good == DF_MISSING) {
/* line bad only if user explicitly asked
* for this column */
if (df_no_use_specs)
line_okay = 0;
-
/* return or ignore line depending on line_okay */
break;
}
- v[output] = (double) gtimegm(&tm);
+ v[output] = df_column[column - 1].datum;
} else if ((column <= df_no_cols)
&& df_column[column - 1].good == DF_GOOD)
v[output] = df_column[column - 1].datum;
Johannes russek wrote:
>
> Hello everybody,
>
> I have a binary file that was created with pack("l*",$time,$value); from
> php.
>
> I can plot the contents of the file fine with
>
> unset key
> set xtics rotate
> plot 'data.bin' binary format='%int32%int32' using 1:2 with lines
>
> however, i would like to have the tics on the x-axis as readable
> date/time.
> but when i use this (with or without set timefmt "%s"):
>
> unset key
> set xdata time
> set format x "%r %D"
> set xtics rotate
> plot 'data.bin' binary format='%int32%int32' u 1:2 with lines
>
> i only get an error:
>
> gnuplot> plot 'data.bin' binary format='%int32%int32' u 1:2 with lines
> ^
> line 0: warning: Skipping data file with no valid points
>
> gnuplot> plot 'data.bin' binary format='%int32%int32' u 1:2 with lines
> ^
> line 0: x range is invalid
>
> what am i doing wrong or how can i read time values from a binary file?
>
> Thanks,
> Johannes
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Gnuplot-info mailing list
> Gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
--
View this message in context: http://www.nabble.com/pulling-x-axis-time-information-from-a-binary-file-tp26008451p26037519.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|