3

I want to plot only some values from a data file My problem is: I only want to plot the lines that are the value of some column set to some value ( run_id == 0101). Is there a gnuplot command, that makes you select the lines you want to plot?

like

 plot 'FTSE100.txt' using 'ATimeOnMarket' :'AAnualisedROI'

when, and only when, column: 'run_id' has the value '0101'

4

1 回答 1

1

看起来您可以使用三元运算符来过滤文件:

plot 'FTSE100.txt' using (column("ATimeOnMarket")):((column("run_id) == 101)?column("AAnualisedROI"):NaN)

您可能可以使用宏使其更容易阅读:

set macro
ATimeOnMarket = "column('ATimeOnMarket')"
run_id = "column('run_id')
AAnualisedROI = "column('AAnualisedROI'))

plot 'FTSE100.txt' u (@ATimeOnMarket):((@run_id == 101) ? @AAnualisedROI : NaN)
于 2013-01-06T21:27:25.730 回答