%W is a week number within a year. Gnuplot cannot recognize it in the timefmt. I have a lot of data sets with a time column containing a year and a week number.
Example:
set xdata time # input for X axis contains time
set timefmt "%Y-%W" # input time format <<< %W NOT RECOGNIZED BY GNUPLOT
set format x "%Y-%W" # output format on axis X
plot '-' using 1:2 title "rawhide" with filledcurve x1
2009-33 8
2009-34 11
2009-35 9
2009-36 33
e
Gnuplot 4.4.2 output:
2009-33 8
-:1: line 1: warning: Bad time format in string
2009-34 11
-:2: line 2: warning: Bad time format in string
2009-35 9
-:3: line 3: warning: Bad time format in string
2009-36 33
-:4: line 4: warning: Bad time format in string
Please consider the proposed patch which fixes this problem by adding %W to the default gstrptime implementation.
Run tested on my data sets.
Proposed patch
The man page for strftime() documents the %W format as
%W The week number of the current year as a decimal number,
range 00 to 53, starting with the first Monday as the
first day of week 01.
Similarly, the man page for strptime() says
%W The week number with Monday the first day of the week (0-53).
The first Monday of January is the first day of week 1.
Your implementation does not appear consistent with these definitions, since it assumes that week 0 contains 7 days. Was your data set created in accordance with a different definition?
Yes, the data set used the same (incorrect) assumption as the patch. Thank you for pointing this out. I'm attaching improved version, which handles the variable length of week 0.
Can you look at this one, please?
Proposed patch v2
A test program comparing jan_first_wday of gnuplot and glibc
M9bxEa <a href="http://mthdpaqrgzev.com/">mthdpaqrgzev</a>, [url=http://beuauejiayfy.com/]beuauejiayfy[/url], [link=http://cxmhnifriusq.com/]cxmhnifriusq[/link], http://bdsbkkdpfqby.com/
bLwUfJ <a href="http://jgerlzxfmnko.com/">jgerlzxfmnko</a>, [url=http://yfflcxyxtjqh.com/]yfflcxyxtjqh[/url], [link=http://pptrvpmwajng.com/]pptrvpmwajng[/link], http://jmbyqmvibhph.com/