From: Mahmood N. <nt_...@ya...> - 2013-09-03 16:49:41
|
Thanks for the quick reply. I understood it but I receive error. Again here is the data file 100 10 M 150 20 M 30 40 H 50 90 M So I ran plot "data.txt" u 1:($3=='M':$2:1/0) So I expect that it compares the third column to 'M' and on a match return the second column. Isn't that? Now I receive None-numeric string found where a numeric expression was expected. Regards, Mahmood ________________________________ From: BBands <bb...@gm...> To: Mahmood Naderan <nt_...@ya...>; gnuplot <gnu...@li...> Sent: Tuesday, September 3, 2013 9:11 PM Subject: Re: [Gnuplot-info] ploting if a special character exist in the line The ternary operator is what you want. Here is a nice little write up: http://gnuplot-surprising.blogspot.com/2011/09/manipulate-data-using-ternary-operator.html John On Tue, Sep 3, 2013 at 9:34 AM, Mahmood Naderan <nt_...@ya...> wrote: > Hi, > I have a data file which looks like this > > 100 10 M > 150 20 M > 30 40 H > 50 90 M > > I want to plot the second column on the rows which has 'M' in their third column (10, 20, 90). Is it possible to directly tell "plot" command to do such thing or not? Otherwise I have to preprocess the file which some languages and then feed it to gnuplot. |