Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

date/time format

265 views
Skip to first unread message

TonyG

unread,
Apr 13, 2012, 9:00:26 AM4/13/12
to
The datafiles I'm dealing with have the following row format:

time1, time2, number1, string1, string2, number2, number3, string3,
string4, number4

04-12 16:10:58.924,04-12
16:10:59.181,0.257698,GROUP_1,GROUP_1,9,100,GROUP_1,SUCCESS,0

I set the date/time format of the first field as

set format x "%1m-%2d %01H:%02M:%06.3S"

but gnuplot 4.6/WinXP returns an error when I try to plot number1 as a
function of time1:

gnuplot> set datafile separator ","
gnuplot> set format x "%1m-%2d %01H:%02M:%06.3S"
gnuplot> pl'output.csv'u($1):($3)
Warning: empty x range [4:4], adjusting to [3.96:4.04]
Bad format character

There's nothing wrong with the datafile that I can see; what am I
doing wrong?

Hans-Bernhard Bröker

unread,
Apr 13, 2012, 6:27:07 PM4/13/12
to
On 13.04.2012 15:00, TonyG wrote:
> I set the date/time format of the first field as
>
> set format x "%1m-%2d %01H:%02M:%06.3S"

Close, but no cigar. That's an _output_ format, but you wanted to
describe how to _input_ your data. You need

set timefmt "%m-%d %H:%M:%S"

instead (note that input formats don't take field widths or precisions).

TonyG

unread,
Apr 14, 2012, 11:00:08 AM4/14/12
to
On Apr 13, 6:27 pm, Hans-Bernhard Bröker <HBBroe...@t-online.de>
wrote:
H-B, I'm still in trouble... I set the parameters based on the Date/
Time Help file example, but am not getting anywhere. I suspected that
the problem may be due to a mixed use of space and commas, thus I
specified

set datafile separator ","
set xdata time
set timefmt "%M-%D %H:%M:%S"
set format x "%3.3S"

but when I try to plot the data:

04-12 16:10:58.649,04-12
16:10:58.695,0.045376,GROUP_1,GROUP_1,1,1,GROUP_1,SUCCESS,0

I'm still getting a time formatting error for each of the tens of
thousands of lines or

gnuplot> plot 'output.csv' using ($1):($3)
^
all points y value undefined!

Desperation slowly sets in...

Hans-Bernhard Bröker

unread,
Apr 14, 2012, 11:48:07 AM4/14/12
to
On 14.04.2012 17:00, TonyG wrote:
> On Apr 13, 6:27 pm, Hans-Bernhard Bröker<HBBroe...@t-online.de>
> wrote:

>> set timefmt "%m-%d %H:%M:%S"

> set timefmt "%M-%D %H:%M:%S"

Does that look exactly like the format I showed you? What do you think
the difference will do?

> I'm still getting a time formatting error for each of the tens of
> thousands of lines or
>
> gnuplot> plot 'output.csv' using ($1):($3)
> ^
> all points y value undefined!

You usually don't want to use '($1)' for time data. Stick to the simpler
'1' instead.
Message has been deleted
0 new messages