Re: Compute values with 'every'

Alexander Stangl <[email protected]>
Newsgroups gmane.comp.graphics.gnuplot.user
Message-ID <CAEEUwSMr_gOTSAWhODcExWe5qb=XPa4Op2obMGnwkcObwUTB8Q@mail.gmail.com>
As commented previously you need to filter out also the points when you
define the y value.
So it should read:
file1 using (($0-3)/4):(int($0)%4 == 0 ? (y=$1,NaN) : int($0)%4 == 3 ? $1/y
: NaN) title "rr100/rr25" ls 9

like this it will plot NaN every 1st, 2nd and 4th line of your four line
data block and for line 3 it plots the data from line3 divided by data from
line 1.

Best,
Alex

On Thu, 3 Dec 2020 at 11:36, Robert von Knobloch <[email protected]> wrote:

> Oh dear! I wrote a little too soon Alex, sorry.
> The trace looks OK at first and then I realised that it had more plotted
> points that the number of data samples (twice as many). These are
> positioned at the integer points of samples on the X axis and also
> erroneously at 1/3 of the distance between these points. (So at X = 1,
> 1.33, 2 etc..)
> I cannot see where these points come from , any ideas?
>
> LG,
>
> Bob
>
> > On 02/12/2020 17:00, Alexander Stangl wrote:
> >> Das sollte jetzt klappen:
> >> statt using 0:... musst du using (($0-3)/4):... verwenden. Dann plottest
> >> du die daten gleich wie die anderen.
> >>
> >> LG
> >
> > Alexander, your solution works perfectly.
> > Again, many thanks for your efforts.
> > My knowledge of gnuplot is not as deep as yours.
> >
> > I'll post to the list as the topic is closed.
> > Bob (Robert) von Knobloch.
> >
> > Solution:
> >
> > set datafile missing NaN
> > y=NaN
> > plot  file1 every 4::0 using 1 title "rr25" ls 1, \
> >       file1 every 4::1 using 1 title "rr50" ls 3, \
> >       file1 every 4::2 using 1 title "rr75" ls 5, \
> >       file1 every 4::3 using 1 title "rr100" ls 7, \
> >       file1 using (($0-3)/4):(int($0)%4 == 0 ? (y=$1) : int($0)%4 == 3 ?
> $1/y
> > : NaN) title "rr100/rr25" ls 9
> >
> >
> > _______________________________________________
> > gnuplot-info mailing list
> > [email protected]
> > Membership management via:
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
> >
>
>

_______________________________________________
gnuplot-info mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.