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


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

Re: data cutoff threshold for `plot`

From ab <ab.3942@googlemail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: data cutoff threshold for `plot`
Date 2012-03-19 00:26 -0700
Organization http://groups.google.com
Message-ID <f588dd23-ba05-4efc-8603-83bdafbb4e0d@l14g2000vbe.googlegroups.com> (permalink)
References <13798827.2811.1332009596089.JavaMail.geo-discussion-forums@vbze11>

Show all headers | View raw


On 17 Mrz., 19:39, bryan <bryanlep...@gmail.com> wrote:
> [ gnuplot 4.6 ]
> Is there something like a threshold that applies to a single plot type after `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, \
> ''         u 1:2 w l threshold=5000
>
> ... so the plot will have impulses above 5000 that stand alone and are not connected to those below 5000. the ones below will appear connected.
>
> -Bryan

Hi,
try to use the ternary operator

f_below(x) = x<5000?     x  : NaN      # Will skip everything above
5000
f_above(x) = x<5000? NaN : x

now you can plot f_below and f_above individually using lines, impules
or whatever.

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


Thread

data cutoff threshold for `plot` bryan <bryanlepore@gmail.com> - 2012-03-17 11:39 -0700
  Re: data cutoff threshold for `plot` ab <ab.3942@googlemail.com> - 2012-03-19 00:26 -0700
    Re: data cutoff threshold for `plot` bryan <bryanlepore@gmail.com> - 2012-03-19 08:25 -0700

csiph-web