0
votes

I have a data file that looks like:

    a               b                     c                   d
9.91804289    0.32890611E-04        2.253113185e-08    2.858389795e-08
9.91804289    0.32890611E-04        2.253113185e-08    2.858389795e-08
9.89517766    0.32597535E-04        2.255018344e-08    2.742542369e-08
9.86882582    0.33125571E-04        2.251589285e-08    2.650318558e-08

Now, all b,c and d are functions of a. However, b varies a lot as a function of a (and attains the same value at various different a). I need to plot c and d as a function of b. But due to this variation of b (basically its one-many nature), I have unwanted branches in the c and d plots. Is there any way in gnuplot where I can plot it the way I want by setting the xrange using a only?

1
Could you please describe in more detail what it is you are trying to plot? Do you want to select only a subset of lines from your data file in which a falls wihtin a given range? - user8153
Yes. Exactly. And for that purpose I want to select it using the range of values in column a while using the data in column b as the x-axis and c & d on y. - Aditya Putatunda

1 Answers

2
votes

Take a look help using for how to filter your input data. If you want to select only those rows in your datafile where the value of the first column is between amin and amax, you could do something like

amin=9.8
amax=9.9
plot "filename.dat" using 2:(($1 > amin && $1 < amax ) ? $3 : NaN) title "c" with points, \
     "" using 2:(($1 > amin && $1 < amax ) ? $4 : NaN) title "d" with points