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


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

Re: skipping values in a data file

From Ethan A Merritt <sfeam@users.sourceforge.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: skipping values in a data file
Date 2017-06-02 13:25 -0700
Organization gnuplot development
Message-ID <ogshd7$lbn$1@dont-email.me> (permalink)
References <1137a62e-23b6-4d9e-8b9f-62e034b6f9db@googlegroups.com> <ogq0k3$ge$1@dont-email.me> <766d85d7-e3d9-4c3d-87be-d5327ae3c764@googlegroups.com>

Show all headers | View raw


hugocoolens@gmail.com wrote:

> Op donderdag 1 juni 2017 23:26:46 UTC+2 schreef Ethan A Merritt:
>> hugocoolens@gmail.com wrote:
>> 
>> > I have a data file with measurements, each measurement has been
>> > repeated 5 times. However because of a bug in the apparatus software
>> > the first and the second measurement are always unreliable, therefore I
>> > want to skip them i.e. I don't want to plot these unreliable data
>> > points, neither do I want to use them for fitting to a function. This
>> > is an example: 1
>> > #unreliable 1.5 #unreliable 3 #reliable
>> > 3.1 #reliable
>> > 2.9 #reliable
>> > #start of next 5 measurements:
>> > 3 #unreliable
>> > 3.1 #unreliable
>> > 3.5 #reliable
>> > 3.4 #reliable
>> > 3.6 #reliable
>> > 
>> > Can anyone here show me how to do is from within Gnuplot?
>> > kind regards,
>> > Hugo
>> 
>> If it is always the first two measurements in the file, you can add "skip
>> 2" to the plot or fit statement:
>> 
>>     plot "foo" skip 2 using 0:1
>> 
>> However your sample above seems to show that that there are multiple
>> blocks of data in the file and in each block the first 2 records are bad.
>> For this you could instead use
>> 
>>     plot "foo" every ::2 using 0:1
>> 
>> But note that you need a blank line between the data blocks for this to
>> work (otherwise gnuplot does not know that new block of data is
>> starting).
>> 
>> See "help every"
>> 
>> Ethan
> 
> Thanks a lot for the reply. Adding an extra blank line is no too
> difficult. Can I also use the "every" syntax in a fit statement? 

Yes.  "plot" and "fit" both use exactly the same data input stage.

> Could you provide an example?

One of the examples in the fit demo uses "every 5" to select points
   http://gnuplot.sourceforge.net/demo_cvs/fit.html

The demo "matrix_every.dem" may also be helpful (it's in the distributed
demo collection but not one of the on-line examples).

	Ethan

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


Thread

skipping values in a data file "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2017-06-01 08:47 -0700
  Re: skipping values in a data file Ethan A Merritt <sfeam@users.sourceforge.net> - 2017-06-01 14:26 -0700
    Re: skipping values in a data file "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2017-06-02 02:39 -0700
      Re: skipping values in a data file Ethan A Merritt <sfeam@users.sourceforge.net> - 2017-06-02 13:25 -0700
        Re: skipping values in a data file "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2017-06-03 11:31 -0700

csiph-web