Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #1500

Re: string comparison in "using"

From sfeam <sfeam@users.sourceforge.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: string comparison in "using"
Followup-To comp.graphics.apps.gnuplot
Date 2012-11-26 08:24 -0800
Organization gnuplot development team
Message-ID <k9053h$d6v$1@dont-email.me> (permalink)
References <k8voqc$bkr$1@news.rz.uni-karlsruhe.de>

Followups directed to: comp.graphics.apps.gnuplot

Show all headers | View raw


Karl wrote:

> Hi,
> 
> neither of the following works
> 
> 
> gnuplot> plot "results.dat" using ($1=='LDPE' ? $2 : 1/0):3
>          Non-numeric string found where a numeric expression was
>          expected
> 
> 
> gnuplot> plot "results.dat" using ($1 eq 'LDPE' ? $2 : 1/0):3
>          internal error : STRING operator applied to non-STRING type
> gnuplot> 
> 
> 
> . How can i select data from a dataset based on a string value?

              using (strcol(1) eq 'LDPE' ? $2 : NaN): 3

> 
> 
>   Karl
> 
> 
> a dataset would be
> 
> LDPE 12 14.5
> LDPE 18 15.2
> HDPE 15 45.2
> LDPE 16 15.1
> HDPE 17 50.1

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

string comparison in "using" Karl <mail.kfr@gmx.net> - 2012-11-26 13:52 +0100
  Re: string comparison in "using" sfeam <sfeam@users.sourceforge.net> - 2012-11-26 08:24 -0800
    Re: string comparison in "using" Karl <mail.kfr@gmx.net> - 2012-11-27 13:45 +0100

csiph-web