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


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

Re: gnuplot conditional plotting with if column value is greater than 2.5

Path csiph.com!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Karl Ratzsch <mail.kfr@gmx.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: gnuplot conditional plotting with if column value is greater than 2.5
Date Mon, 27 Nov 2017 14:17:23 +0100
Organization solani.org
Lines 26
Message-ID <ovh393$ndk$1@solani.org> (permalink)
References <f532384b-6919-4584-9b26-24a203713c1f@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Trace solani.org 1511788643 23988 eJwFwYEBACAEBMCVKF7G+cT+I3TnG4oKg8N8fGTwBrcPIrkKcUiWjNA3e7Gqtc0ymCpEfDOnEbs= (27 Nov 2017 13:17:23 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Mon, 27 Nov 2017 13:17:23 +0000 (UTC)
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
X-User-ID eJwFwYEBwCAIA7CXhm1RzwGE/09YIrh5bbqcGs1tApG673iDHYIFLCdGZdy2vjXqw36uLPwc0BEq
Content-Language de-DE-1901
In-Reply-To <f532384b-6919-4584-9b26-24a203713c1f@googlegroups.com>
X-NNTP-Posting-Host eJwFwQkBACAIA8BKImxIHObTP4J3cBp3BsHAwwtntHLywTcHW1y4Uh3jaZpV2LpjpkJg+QcQXRBy
Cancel-Lock sha1:2Sn5YuKLajncx3C8yx5Qin5LJHQ=
Xref csiph.com comp.graphics.apps.gnuplot:3827

Show key headers only | View raw


Am 27.11.2017 um 00:16 schrieb dmngaya@gmail.com:
> Hi all,
> I have a data file with two columns like this:
> date avelp1219p01 avelp1219p02 avelp1219p03 avelp1219p04 
> 2017.11.12 1.9294 2.4847 1.7317 2.0424
> 2017.11.13 1.9451 2.49669 1.7477 1.99816 
> 2017.11.14 1.9451 2.49669 1.7477 1.99816 
> 2017.11.15 1.9451 2.49669 1.7477 1.99816 
> 2017.11.16 1.9451 2.49669 1.7477 1.99816 
> 2017.11.17 1.9451 2.49669 1.7477 1.99816
> I want to plot the colums value for avelp1219p01, avelp1219p02, avelp1219p03, avelp1219p04 if column value is greater than or equal 2.5.

You need the ternary operator (a ? b : c), which means "if a!=0 return
b, otherwise c"

plot dataf us (column("avelp1219") > 2.5 ? column("evelp1219") : NaN)

or

plot dataf us (val=column("evelp12"), val>2.5?val:NaN)

(latter uses the serial evaluation operator "," , to avoid having to
type in the column() function  twice)


Cheers, Karl

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


Thread

gnuplot conditional plotting with if column value is greater than 2.5 dmngaya@gmail.com - 2017-11-26 15:16 -0800
  Re: gnuplot conditional plotting with if column value is greater than 2.5 Karl Ratzsch <mail.kfr@gmx.net> - 2017-11-27 14:17 +0100

csiph-web