|
From: <pl...@pi...> - 2016-11-19 09:16:19
|
On 19/11/16 04:06, Daniel J Sebald wrote: > I just used the time format in a plot. It's nice, incorporating the > date and time and all. So thank you to whomever. > > It did take me a bit to figure out though why something like this failed: > > set timefmt "%m/%d/%y %H:%M" > plot "data" using 1:2 > > with data something like > > 03/03/16 11:30 23.5 > 03/03/16 11:45 24.8 > ... > > It's because the datafile.c reading routine recognizes that first space > as a delimiter such that field ':2' is actually 11 in both cases shown. > That's fine, as the following works: > > plot "data" using 1:3 > > and the documentation gives proper examples and all, if not explicitly > stating. I think this should be explicitly documented. I came up against this a while back and sussed it just by suck and see. This solution does work quite well but is actually a hack / workaround since it concatenates both col 1 and col 2 to be col 1 but still calls col 3 , col 3. This is not intuitive and breaks the definitions of what are regarded as separate input columns. Thus it should be documented explicitly rather than just being included in an example. Peter. > > However, it's a bit of a mental juxtaposition because the person > scripting the code is thinking of the "03/03/16 11:30" as the "first" > entry. Now, gnuplot has string inputs, such as in energy_circles.dat of > the demo subdirectory. So, I'm wondering if the the date/time data > entry could also accept a datafile string. It shouldn't be too much of > a C-code alteration. For example, this might be the equivalent to the > above: > > plot "data" using 1:2 > > with data > > "03/03/16 11:30" 23.5 > "03/03/16 11:45" 24.8 > ... > > I tried that, and gnuplot doesn't allow it (no surprise, as it isn't > documented to do so). The way I see it, the user might be more inclined > to think of date/time data in that fashion. > > Dan > > ------------------------------------------------------------------------------ > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > |