Menu ▾ ▴

#588 periodically exclude data, or more flexible choice specification

None
closed
nobody
None
5
2026-10-25
2025-05-09
No

The keyword "every" chooses data periodically. Inversely, I think it may be usefull to exclude data periodically in some cases.

For example,
every 5::0
selects data points 1,6,11,16,... in each blocks. I will offer
exclude 5::0
selects data points 2,3,4,5,7,8,9,10,12,13,14,15,... in each blocks.

Moreover, I hope more flexible choice specification like as
every p1-3,7-10 b3,5,9
which selects data points 1,2,3,7,8,9,10 in each blocks 3,5,9.

Discussion

  • Ethan Merritt

    Ethan Merritt - 2025-05-09

    I think the "exclude" functionality is already possible in current gnuplot using the if keyword.

    plot data using 1:2 if (int($0)%5 != 0)
    is equivalent to
    plot data exclude 5::0 using 1:2

    The if mechanism can also handle more complicated combinations although it doesn't provide a simple syntax like you show in your second request. Something like this:

    function $Select() << EOF
        p = int(column(0))
        point_ok = (p == 1 || p == 2 || p == 3 || (p >= 7 && p <= 10))
        b = int(column(-2))
        block_ok = (b == 3 || b == 5 || b == 9)
        return (point_ok && block_ok)
    EOF
    
    set title "complicated selection criteria"
    plot $BLOCKS using 1:2 if ($Select())
    

    See attached example script

     
  • Ethan Merritt

    Ethan Merritt - 2026-10-25
    • status: open --> closed
    • Group: -->
     

Log in to post a comment.