• want to color each 50 data points differently from a list of 150 data p

    From satyajitkhatua09@gmail.com@21:1/5 to All on Wed Mar 4 07:13:36 2020
    Dear Users,
    Recently I have generated a data file that contains 150 data points. For comparing purpose I want to color each 50 data points out of 150 in different color. I have googled for it thinking if there is any solutions related to this problem, but
    I couldn't really find any. As I not an expert in Gnuplot, so I have to ask this question here. Please help me out to solve the problem.

    Thanks in advance,
    Satyajit Khatua

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?J=c3=b6rg_Buchholz?=@21:1/5 to satyajitkhatua09@gmail.com on Thu Mar 5 09:34:25 2020
    On 04.03.2020 16:13, satyajitkhatua09@gmail.com wrote:
    Dear Users, Recently I have generated a data file that contains 150
    data points. For comparing purpose I want to color each 50 data
    points out of 150 in different color. I have googled for it thinking
    if there is any solutions related to this problem, but I couldn't
    really find any. As I not an expert in Gnuplot, so I have to ask this question here. Please help me out to solve the problem.

    Thanks in advance, Satyajit Khatua


    This example gives you each 3 points in a different color:

    reset
    set encoding utf8
    set grid
    set xrange [0:10]
    set yrange [0:10]
    $data << EOD
    1 4 6 5 9 2 7 6
    2 5 7 3 2 7 2 8
    3 7 3 9 3 2 1 0
    4 7 5 2 8 1 2 8
    5 5 2 9 4 2 6 1
    6 7 3 9 3 2 1 0
    7 5 7 3 2 7 2 8
    8 7 3 9 3 2 1 0
    9 7 5 2 8 1 2 8
    EOD
    set pointsize 5
    plot $data every ::0::2 u 1:2 w p pt 7 lc 'red', $data every ::3::5 u
    1:2 w p pt 7 lc 'blue', $data every ::6::9 u 1:2 w p pt 7 lc 'green'


    "every" seams to be one solution.

    Jörg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Buxton@21:1/5 to All on Thu Mar 5 05:56:50 2020
    You'll find some very elegant solutions here, but if I understand it correctly you could just open the file and put a couple of carriage returns whenever you want to separate the points. Then

    plot 'data.dat' i 0, '' i 1 , '' i 2

    where i stands for index.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?J=c3=b6rg_Buchholz?=@21:1/5 to satyajitkhatua09@gmail.com on Thu Mar 5 20:44:18 2020
    On 04/03/2020 16:13, satyajitkhatua09@gmail.com wrote:
    Dear Users, Recently I have generated a data file that contains 150
    data points. For comparing purpose I want to color each 50 data
    points out of 150 in different color. I have googled for it thinking
    if there is any solutions related to this problem, but I couldn't
    really find any. As I not an expert in Gnuplot, so I have to ask this question here. Please help me out to solve the problem.

    Thanks in advance, Satyajit Khatua


    you can do it also with "plot for":

    reset
    set encoding utf8
    set grid
    set xrange [0:10]
    set yrange [0:10]
    $data << EOD
    1 4 6 5 9 2 7 6
    2 5 7 3 2 7 2 8
    3 7 3 9 3 2 1 0
    4 7 5 2 8 1 2 8
    5 5 2 9 4 2 6 1
    6 7 3 9 3 2 1 0
    7 5 7 3 2 7 2 8
    8 7 3 9 3 2 1 0
    9 7 5 2 8 1 2 8
    EOD
    set pointsize 5
    plot for [i = 0:8:3] $data every ::i::(i+2) u 1:2 w p pt 7


    So if you will do it with your 150 points in column 1 (X-Value) and
    column 2 (Y-Value) in the file "data.dat"

    plot for [i = 1:150:50] 'data.dat' every ::(i-1)::(i+48) u 1:2 w p pt 7

    Jörg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From SATYAJIT KHATUA@21:1/5 to All on Fri Mar 6 06:06:40 2020
    Thanks both of you for your suggestions. Will try these out.

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