There are several problems:
1 - You should use using
or u
like:
plot "data.txt" u ($1 <=0 ? $2 : 1/0)
2 - In this form you plot the 2nd column (or nothing; depending on the 1st column) aganist the 0th column (which (nearly) equals to the line number). To examine this effect, try and see:
plot "data.txt" u 2
3 - ANSWER: the correct syntax is like:
plot 'data.txt' u ($1<=0?$1:1/0):2
or
plot 'data.txt' u 1:($1<=0?$2:1/0)
which depends on what do you want to plot actually. The difference between them that the first one sets the xrange
of the plot up to 0 while the second one displays a wider xrange
(up to x_max of your data). However, in your case, you could use both of them. (Or you can mix them.) Eg.:
plot 'data.txt' u 1:($1<=40?$2:1/0) w filledcurves y=0, '' u 1:($1>40?$2:1/0) w l lc 1
The problem with your plot was that using a 'naked' filledcurves
with a 2 column data set, the default option is closed
which threats the dataset as a closed polygon.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…