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


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

Re: Missing points in multi line plot not being omitted

From Ethan Merritt <sfeam@users.sf.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Missing points in multi line plot not being omitted
Date 2018-03-08 19:54 +0000
Organization A noiseless patient Spider
Message-ID <p7s4dt$kk4$1@dont-email.me> (permalink)
References <e3db9e9a-e4f1-44e3-99e4-704d0d59380f@googlegroups.com> <p7r3t7$mhq$1@dont-email.me> <97425965-67e4-4299-a0e5-54e6d70e5789@googlegroups.com> <p7s1qb$pn$1@dont-email.me>

Show all headers | View raw


On Thu, 08 Mar 2018 20:10:02 +0100, Jörg Buchholz wrote:

> On 08/03/18 15:35, Marius Schamschula wrote:
>> On Thursday, March 8, 2018 at 4:39:37 AM UTC-6, Jörg Buchholz wrote:
>>> On 07.03.2018 19:33, Marius Schamschula wrote:
>>>> I'm trying to make a plot of wind speed and wind gusts. The data for
>>>> wind gusts is not continuous. If I use datafile missing on the wind
>>>> gust data by itself, things work as expectedly, but if I try to plot
>>>> gusts along with wind speed, gusts data are shown for times where
>>>> there is no data. The plot omits gusts data at the beginning and end,
>>>> but in the middle line segments are drawn where they should not. For
>>>> example
>>>>
>>>> set datafile missing NaN set grid set time set xdata time set timefmt
>>>> "%Y-%m-%d:%H:%M:%S"
>>>> unset timestamp plot '-' u 1:2 t 'Wind' w lines lt rgb "blue", '-' u
>>>> 1:3 t 'Gust' w lines
>>>
>>>
>>> You can (or must?) use the following syntax to get a gap on the plot:
>>> plot '-' u 1:($2) t 'Wind' w lines lt rgb "blue", '-' u 1:($3) t
>>> 'Gust' w lines
>>>
>>> Write in the plot command for the "Y-column" ($2), as example for
>>> column 2 as Y-value.
>>>
>>> Jörg
>> 
>> Given the example in the documentation, I also have tried just that
>> syntax. The result: no plot at all.
>> 
>> 
> There is a mistake at your "set datafile missing", the NaN must be in
> quotes.

"set datafile missing NaN"   (with no quotes around the NaN) is correct
syntax for the desired behaviour starting in version 5.0.6.

Here is the output from "help set datafile missing" in version 5.0.6

%%%%%
 Old gnuplot versions handled NaN differently depending of the form of the
 `using` clause, as shown in plots (c) and (d).  Gnuplot now handles NaN
 the same whether the input column was specified as N or ($N).
 See also the imageNaN demo.
 As of version 5.0.6 this is also true for the missing value flag.
 Earlier versions failed to recognize the missing value flag if the plot
 command specified `using ($N)` rather than `using N`.  Note, however, that
 even in current gnuplot using a "missing" value for computation will
 result in NaN. I.e. a `missing` string in either columns 1 or 2 will cause
 `using ($1+$2)` to evaluate as NaN.  If you nevertheless want to treat
 this as missing data, use the command `set datafile missing NaN`.
%%%%%

    Ethan

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


Thread

Missing points in multi line plot not being omitted Marius Schamschula <mschamschula@gmail.com> - 2018-03-07 10:33 -0800
  Re: Missing points in multi line plot not being omitted Jörg Buchholz <bookwood4new@freenet.de> - 2018-03-08 11:39 +0100
    Re: Missing points in multi line plot not being omitted Marius Schamschula <mschamschula@gmail.com> - 2018-03-08 06:35 -0800
      Re: Missing points in multi line plot not being omitted Chris Elvidge <chris@mshome.net> - 2018-03-08 16:24 +0000
      Re: Missing points in multi line plot not being omitted Jörg Buchholz <bookwood4new@freenet.de> - 2018-03-08 20:10 +0100
        Re: Missing points in multi line plot not being omitted Ethan Merritt <sfeam@users.sf.net> - 2018-03-08 19:54 +0000
        Re: Missing points in multi line plot not being omitted Chris Elvidge <chris@mshome.net> - 2018-03-08 20:40 +0000
  Re: Missing points in multi line plot not being omitted Marius Schamschula <mschamschula@gmail.com> - 2018-03-09 10:48 -0800
    Re: Missing points in multi line plot not being omitted Jörg Buchholz <bookwood4new@freenet.de> - 2018-03-09 21:09 +0100
      Re: Missing points in multi line plot not being omitted Ethan A Merritt <EAMerritt@gmail.com> - 2018-03-09 23:18 -0800
        Re: Missing points in multi line plot not being omitted Jörg Buchholz <bookwood4new@freenet.de> - 2018-03-10 10:57 +0100
          Re: Missing points in multi line plot not being omitted Chris Elvidge <chris@mshome.net> - 2018-03-10 11:09 +0000
            Re: Missing points in multi line plot not being omitted Jörg Buchholz <bookwood4new@freenet.de> - 2018-03-10 17:40 +0100
              Re: Missing points in multi line plot not being omitted Chris Elvidge <chris@mshome.net> - 2018-03-10 17:01 +0000
                Re: Missing points in multi line plot not being omitted Jörg Buchholz <bookwood4new@freenet.de> - 2018-03-11 09:47 +0100
                Re: Missing points in multi line plot not being omitted Chris Elvidge <chris@mshome.net> - 2018-03-11 10:41 +0000

csiph-web