Gnuplot plotting data from a file up to some row

后端 未结 5 1552
逝去的感伤
逝去的感伤 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条回答
  •  孤街浪徒
    2020-11-30 23:48

    Gnuplot ignores NaN values. This works for me for a specified range of the x coordinate. Not sure how to specify row range though.

    cutoff(c1,c2,xmin,xmax) = (c1>=xmin)*(c1<=xmax) ? c2 : NaN
    plot "data.txt" u 1:(cutoff(($1),($2),1000,2000))
    

提交回复
热议问题