Gnuplot plotting data from a file up to some row

后端 未结 5 1545
逝去的感伤
逝去的感伤 2020-11-30 22:44

I have data in some text file which has let\'s say 10000 rows and 2 columns. I know that I can plot it easily by plot \"filename.txt\" using 1:2 with lines . Wh

5条回答
  •  旧时难觅i
    2020-11-30 23:38

    It appears that the "every" command in gnuplot is what you're looking for:

    plot "filename.txt" every ::1000::2000 using 1:2 with lines
    

    Alternatively, pre-process your file to select the rows in which you are interested. For example, using awk:

    awk "NR>=1000 && NR<=2000" filename.txt > processed.txt
    

    Then use the resulting "processed.txt" in your existing gnuplot command/script.

提交回复
热议问题