Menu ▾ ▴

#2848 Windows 6.03: unclear logic of gaps in the plot

open
nobody
None
2026-01-12
2026-01-01
No
$IN <<EOI
7   9
9   12
12
15  24
24  36
36  56
56  90
EOI

plot $IN u 1:($2*$1/$1) w lp, '' u 1:($2+10) w lp

creates a plot with a gap in the first graph, but not in the second. Moreover, one can check that the reason for the gap is not division.

According to what I can find in the documentation, both plots should follow the same logic of "including/excluding" the input lines. (Same seems to be dictated by "be logical" mantra.)

Discussion

  • Ethan Merritt

    Ethan Merritt - 2026-01-12

    The difference will go away if you tell the program to treat a coordinate whose value is found to be NaN the same as a coordinate that is missing from the input data.

    set datafile missing NaN

    The next question is obviously "why does $2*$1/$1 evaluate to NaN while $2+10 apparently does not?". Good question. When reading in a line of data, the program returns an error flag DF_MISSING to indicate that a required coordinate is missing. The test for that condition is trivial if the coordinate is simply the content of a particular column. If the coordinate is the result of a computation, that is harder to detect. I don't know exactly why in this case the program correctly identifies that one of those expressions depends a missing value but fails to recognize the same thing for the other expression.

     

Log in to post a comment.