|
From: David L. <da...@la...> - 2015-01-09 22:14:34
|
I ran into a case that worked with v4.x that doesn't work with v5, namely when plotting points from a file where the x column is a timestamp and the file had column headers, v4 seems to have ignored the header column (apparently deciding that the timestamp was invalid and so throwing out the entire line), while v5 interprets the timestamp as 01-01-0000 and scaleing the entire plot to include this date. David Lang |
|
From: Ethan A M. <EAM...@gm...> - 2015-01-10 01:08:26
|
On Friday, 09 January 2015 02:14:27 PM David Lang wrote:
> I ran into a case that worked with v4.x that doesn't work with v5, namely when
> plotting points from a file where the x column is a timestamp and the file had
> column headers, v4 seems to have ignored the header column (apparently deciding
> that the timestamp was invalid and so throwing out the entire line), while v5
> interprets the timestamp as 01-01-0000 and scaleing the entire plot to include
> this date.
There are a number of things you could do.
1) You could tell gnuplot that the first line contains column headers:
set key autotitle columnhead
2) You could tell it to skip the first line of the file
plot 'foo' skip 1 using ...
3) You could explicitly filter out 0 times from the input
plot 'foo' using ($1 == 0 ? NaN : timecol(1)): ...
Possibly other alternatives as well.
Ethan
|
|
From: David L. <da...@la...> - 2015-01-10 02:21:49
|
On Fri, 9 Jan 2015, Ethan A Merritt wrote: > On Friday, 09 January 2015 02:14:27 PM David Lang wrote: >> I ran into a case that worked with v4.x that doesn't work with v5, namely when >> plotting points from a file where the x column is a timestamp and the file had >> column headers, v4 seems to have ignored the header column (apparently deciding >> that the timestamp was invalid and so throwing out the entire line), while v5 >> interprets the timestamp as 01-01-0000 and scaleing the entire plot to include >> this date. > > There are a number of things you could do. > > 1) You could tell gnuplot that the first line contains column headers: > > set key autotitle columnhead > > 2) You could tell it to skip the first line of the file > > plot 'foo' skip 1 using ... > > 3) You could explicitly filter out 0 times from the input > > plot 'foo' using ($1 == 0 ? NaN : timecol(1)): ... > > Possibly other alternatives as well. In my case I changed the data fetching routine to filter out the column headers from the file. I just was surprised when the plot that was working on my production system didn't work on my desktop (where I had installed 5.0). If this wasn't something that worked on the older versions, I would just shrug it off as "don't do that", but the fact that it broke a working config made me post about it. David Lang |
|
From: Ethan A M. <EAM...@gm...> - 2015-01-10 05:16:12
|
On Friday, 09 January 2015 02:14:27 PM David Lang wrote: > I ran into a case that worked with v4.x that doesn't work with v5, namely when > plotting points from a file where the x column is a timestamp and the file had > column headers, v4 seems to have ignored the header column (apparently deciding > that the timestamp was invalid and so throwing out the entire line), while v5 > interprets the timestamp as 01-01-0000 and scaleing the entire plot to include > this date. > I just was surprised when the plot that was working on my production > system didn't work on my desktop (where I had installed 5.0). If this > wasn't something that worked on the older versions, I would just shrug > it off as "don't do that", but the fact that it broke a working config > made me post about it. Can you provide the first few lines from a data file that was handled differently by version 4 than by version 5? It is true that the interpretation of timestamps has changed because version 5 uses a different epoch date, but a zero value should be legal in either version. It's not clear to me why there would be a difference in recognizing a line as a header vs legal input. Also I don't actually see how you could get incorrect interpretation as 01-01-0000. That's the epoch date for version 4 but not for version 5 (01-01-1970). Was that a typo? Ethan |
|
From: David L. <da...@la...> - 2015-01-10 06:13:50
|
On Fri, 9 Jan 2015, Ethan A Merritt wrote: > On Friday, 09 January 2015 02:14:27 PM David Lang wrote: >> I ran into a case that worked with v4.x that doesn't work with v5, namely when >> plotting points from a file where the x column is a timestamp and the file had >> column headers, v4 seems to have ignored the header column (apparently deciding >> that the timestamp was invalid and so throwing out the entire line), while v5 >> interprets the timestamp as 01-01-0000 and scaleing the entire plot to include >> this date. > >> I just was surprised when the plot that was working on my production >> system didn't work on my desktop (where I had installed 5.0). If this >> wasn't something that worked on the older versions, I would just shrug >> it off as "don't do that", but the fact that it broke a working config >> made me post about it. > > Can you provide the first few lines from a data file that was handled > differently by version 4 than by version 5? site_name|day|num_assets AMS|2014-12-09|596 where column 2 is the x axis with timefmt "%Y-%m-%d" stripping out the first line made it work in v5 > It is true that the interpretation of timestamps has changed > because version 5 uses a different epoch date, but a zero value should > be legal in either version. It's not clear to me why there > would be a difference in recognizing a line as a header vs legal input. > > Also I don't actually see how you could get incorrect interpretation > as 01-01-0000. That's the epoch date for version 4 but not for version 5 > (01-01-1970). Was that a typo? it could be that I was looking on the wrong machine when I found that date. I wrapped the plot with table output to look and see what was wrong. valid dates went from 2014-12-09 to 2015-01-08 and on v4.4 (ubuntu 12.04) the produced plot was correct, but with the exact same files running on v5 the plot went from year -400 or so up to year 2400 or so (I can recreate this exactly on monday, including sending you the files) looking at it now, it could be that I am seeing the wrong thing with the date, it could be that both of them were misinterpreting the date, but the old one saw the values were not numbers and didn't plot them while the new one converted the string to zero???? (wild speculation here until I can reproduce it at work monday) David Lang > Ethan > |
|
From: Ethan A M. <EAM...@gm...> - 2015-01-11 05:32:15
|
On Friday, 09 January 2015 10:13:41 PM David Lang wrote:
> On Fri, 9 Jan 2015, Ethan A Merritt wrote:
>
> > On Friday, 09 January 2015 02:14:27 PM David Lang wrote:
> >> I ran into a case that worked with v4.x that doesn't work with v5, namely when
> >> plotting points from a file where the x column is a timestamp and the file had
> >> column headers, v4 seems to have ignored the header column (apparently deciding
> >> that the timestamp was invalid and so throwing out the entire line), while v5
> >> interprets the timestamp as 01-01-0000 and scaleing the entire plot to include
> >> this date.
> >
> >> I just was surprised when the plot that was working on my production
> >> system didn't work on my desktop (where I had installed 5.0). If this
> >> wasn't something that worked on the older versions, I would just shrug
> >> it off as "don't do that", but the fact that it broke a working config
> >> made me post about it.
> >
> > Can you provide the first few lines from a data file that was handled
> > differently by version 4 than by version 5?
>
> site_name|day|num_assets
> AMS|2014-12-09|596
>
> where column 2 is the x axis with timefmt "%Y-%m-%d"
>
> stripping out the first line made it work in v5
I can't reproduce this from the information given.
For me it works in both gnuplot 4.6.6 and gnuplot 5.0.0.
I used the following test script:
set datafile sep '|'
set xdata time
set timefmt '%Y-%m-%d'
plot 'timebug.dat' using 2:3:1 with labels
where 'timebug.dat' contained the two lines above.
Here is the v5 output with 'set term dumb'
602 +-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+
+ + + + + + + + + + + + +
| 'timebug.dat' using 2:3:1 |
600 +-+ +-+
| |
| |
598 +-+ +-+
| |
| |
596 +-+ AMS +-+
| |
| |
| |
594 +-+ +-+
| |
| |
592 +-+ +-+
| |
+ + + + + + + + + + + + +
590 +-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+
06/01/14/01/1401/14/01/14/01/14/01/14/01/1401/15/01/1501/15/01/15/01/15/01/15
Ethan
|
|
From: David L. <da...@la...> - 2015-01-13 19:43:48
|
On Sat, 10 Jan 2015, Ethan A Merritt wrote: > On Friday, 09 January 2015 10:13:41 PM David Lang wrote: >> On Fri, 9 Jan 2015, Ethan A Merritt wrote: >> >>> On Friday, 09 January 2015 02:14:27 PM David Lang wrote: >>>> I ran into a case that worked with v4.x that doesn't work with v5, namely when >>>> plotting points from a file where the x column is a timestamp and the file had >>>> column headers, v4 seems to have ignored the header column (apparently deciding >>>> that the timestamp was invalid and so throwing out the entire line), while v5 >>>> interprets the timestamp as 01-01-0000 and scaleing the entire plot to include >>>> this date. >>> >>>> I just was surprised when the plot that was working on my production >>>> system didn't work on my desktop (where I had installed 5.0). If this >>>> wasn't something that worked on the older versions, I would just shrug >>>> it off as "don't do that", but the fact that it broke a working config >>>> made me post about it. >>> >>> Can you provide the first few lines from a data file that was handled >>> differently by version 4 than by version 5? >> >> site_name|day|num_assets >> AMS|2014-12-09|596 >> >> where column 2 is the x axis with timefmt "%Y-%m-%d" >> >> stripping out the first line made it work in v5 > > I can't reproduce this from the information given. and I can't reproduce it today either :-( If I run into it again, I'll send details. David Lang |