Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!l14g2000vbe.googlegroups.com!not-for-mail From: ab Newsgroups: comp.graphics.apps.gnuplot Subject: Re: data cutoff threshold for `plot` Date: Mon, 19 Mar 2012 00:26:02 -0700 (PDT) Organization: http://groups.google.com Lines: 32 Message-ID: References: <13798827.2811.1332009596089.JavaMail.geo-discussion-forums@vbze11> NNTP-Posting-Host: 194.99.122.193 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1332141962 2795 127.0.0.1 (19 Mar 2012 07:26:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 19 Mar 2012 07:26:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l14g2000vbe.googlegroups.com; posting-host=194.99.122.193; posting-account=aUX_SgoAAAANFc1Z3AbGx-co6QimaYdU User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe) Xref: csiph.com comp.graphics.apps.gnuplot:987 On 17 Mrz., 19:39, bryan wrote: > [ gnuplot 4.6 ] > Is there something like a threshold that applies to a single plot type af= ter `plot` is given? If this can be done using two y-axes, there's already = a lot in the newsgroup for that I can try. > > I have some x/y data. I'd like to combine impulses with a line, however, = I'd like to plot the line for data below some threshold. e.g. impulses for = all data, but a line to connect tops of the impulses for data points below = some value e.g. 5000 (see below) > > imaginary pseudo-code to illustrate what I'd like to do: > > yrange [0:10000] > plot \ > 'data.dat' u 1:2 w i, \ > '' =A0 =A0 =A0 =A0 u 1:2 w l threshold=3D5000 > > ... so the plot will have impulses above 5000 that stand alone and are no= t connected to those below 5000. the ones below will appear connected. > > -Bryan Hi, try to use the ternary operator f_below(x) =3D x<5000? x : NaN # Will skip everything above 5000 f_above(x) =3D x<5000? NaN : x now you can plot f_below and f_above individually using lines, impules or whatever.