Menu

#1911 invalidating data points with conditional operator does not work when data is binary

None
closed-fixed
nobody
None
2017-02-23
2017-02-18
No

Hello,
this case is similar to https://sourceforge.net/p/gnuplot/bugs/1107/ of Hiroki Motoyoshi in that NaN leads to data points shown at the last value instead of being omitted. The difference to that bug is that the NaN is not read from the binary file but calculated while reading a binary file.

My test data consists of two columns,
$1 is 0 1 2 3 4 5 6 7 8,
$2 is 3 2 1 0 0 0 1 2 3.
I prepared two files containing that data, a binary and a text file.
I want to suppress $1 where $2 == 0.

plot 'binNaNtest.dat' \
binary record=0 format="%2uchar" using 0:1 w l, '' \
binary record=0 format="%2uchar" using 0:2 w l, '' \
binary record=0 format="%2uchar" using 0:(($2>0.5?1.:1/0)*$1) w p;

plot 'txtNaNtest.dat' \
using 0:1 w l, '' \
using 0:2 w l, '' \
using 0:(($2>0.5?1.:1/0)*$1) w p;

It works with the text file, but gnuplot shows three extra points with y=2 when reading the binary file.

1 Attachments

Discussion

<< < 1 2 (Page 2 of 2)
  • Rainald Koch

    Rainald Koch - 2017-02-23

    4rd leaf:
    Just a reminder to the problem stated in the first post of this thread. Invalidating y values (as exemplified in the manual and perfectly working with text files) should also work with binary files.

     
  • Ethan Merritt

    Ethan Merritt - 2017-03-17
    • Status: pending-fixed --> closed-fixed
     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.