From: Ethan M. <eam...@gm...> - 2020-07-19 00:49:26
|
On Saturday, 18 July 2020 15:51:04 PDT Juhász Péter wrote: > Hi, > > I've ran into an issue with time data that looks like a bug. > > The script below works as expected: > > ################ > $data << END > 2020-07-01 1.1 > 2020-07-08 2.2 > 2020-07-15 3.3 > END > > set xdata time > set timefmt "%Y-%m-%d" > #set ydata time > plot $data u 1:2 w lp > ############### > > It produces a plot with correctly parsed and displayed dates on the x > axis, and the x range is also sensible. > > But uncomment the `set ydata time` line and it fails: > > ################ > "x.plt" line 10: warning: Skipping data file with no valid > points > > gnuplot> plot $data u 1:2 w lp > ^ > "x.plt" line 10: x range is invalid > ############## > > I can sort of understand that it fails because it can't parse the > second column as date - but then why does it report the *x* range as > invalid? Since all of the points are invalid (because of y), it has no data left to use for autoscaling x. Therefore the range remains [VERYLARGE:-VERYLARGE], which is an invalid range. Perhaps easier to understand what's going on if you leave time data and time formats out of it: ############ $NAN << EOD NaN NaN NaN NaN EOD plot $NAN using 1:2 x range is invalid show xrange set xrange [ * : * ] noreverse writeback # (currently [8.98847e+307:-8.98847e+307] ) set xdata time show xrange set xrange [ * : * ] noreverse writeback # (currently [" warning: time value out of range 32650/35/00,-468425088:00":" warning: time value out of range 32650/35/00,-468425088:00"] ) ############ > > Even more spooky is what it thinks about the x range after the failed > plot: > ############## > gnuplot> sh xr > > set xdata time > set xrange [ * : * ] noreverse writeback # (currently > [" warning: time value out of range > 0000-35-32586":" warning: time value out of range > 0000-35-32586"] ) > ############# > > If I run gnuplot with valgrind, it barfs some "Conditional jump or move > depends on uninitialised value(s)" errors, so some internal state is > definitely corrupted. Dunno. Valgrind doesn't complain here. cheers, Ethan > > Best regards, > Peter Juhasz > > > > > > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > |