• Plot data using every

    From s1291@21:1/5 to All on Wed Oct 30 07:38:18 2019
    Hello,
    I have a single block of data points in a file: data.dat, For example let's consider the following example of data.dat file:

    1 1.0
    2 2.0
    3 3.0
    4 4.0
    5 5.0
    6 6.0
    7 7.0

    To plot only the points with odd x value:

    plot 'data.dat' u 1:2 every 2 w lp

    This will plot the points (1, 1.0), (3, 3.0), (5, 5.0), (7, 7.0).

    What if I want to plot the points with even x value using 'every' keyword? that is, the points (2, 2.0), (4, 4.0) (6, 6.0).

    Thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker@21:1/5 to All on Wed Oct 30 20:19:26 2019
    Am 30.10.2019 um 15:38 schrieb s1291:

    What if I want to plot the points with even x value using 'every' keyword? that is, the points (2, 2.0), (4, 4.0) (6, 6.0).

    Then you continue reading the documentation of the 'every' option, which
    you already found.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From s1291@21:1/5 to All on Wed Oct 30 12:29:14 2019
    On Wednesday, October 30, 2019 at 8:19:30 PM UTC+1, Hans-Bernhard Bröker wrote:
    Am 30.10.2019 um 15:38 schrieb s1291:

    What if I want to plot the points with even x value using 'every' keyword? that is, the points (2, 2.0), (4, 4.0) (6, 6.0).

    Then you continue reading the documentation of the 'every' option, which
    you already found.

    Thank you for your reply.
    I've read the documentation but I don't see how to do that.
    Could you just post it?
    Thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Karl Ratzsch@21:1/5 to All on Thu Oct 31 08:38:25 2019
    Am 30.10.2019 um 20:29 schrieb s1291:
    On Wednesday, October 30, 2019 at 8:19:30 PM UTC+1, Hans-Bernhard Bröker wrote:
    Am 30.10.2019 um 15:38 schrieb s1291:

    What if I want to plot the points with even x value using 'every' keyword? that is, the points (2, 2.0), (4, 4.0) (6, 6.0).

    Then you continue reading the documentation of the 'every' option, which
    you already found.

    Thank you for your reply.
    I've read the documentation but I don't see how to do that.

    Read again ;) (under "help every")

    plot 'file' every {<point_incr>}
    {:{<block_incr>}
    {:{<start_point>}
    {:{<start_block>}
    {:{<end_point>}
    {:<end_block>}}}}}

    Your default start_point is zero. You just set it to "1":

    plot dataf every 2::1

    Alternative (plot even data, not even point/line numbers)

    plot dataf us ($1 % 2 == 0 ? $1 : NaN):2

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)