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


Groups > comp.graphics.apps.gnuplot > #3543 > unrolled thread

Ignore missing data in the desired way

Started byu.gotzes@gmail.com
First post2017-01-20 01:35 -0800
Last post2017-01-21 16:26 -0800
Articles 5 — 4 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  Ignore missing data in the desired way u.gotzes@gmail.com - 2017-01-20 01:35 -0800
    Re: Ignore missing data in the desired way Karl Ratzsch <mail.kfr@gmx.net> - 2017-01-20 12:05 +0100
      Re: Ignore missing data in the desired way Ethan A Merritt <sfeam@users.sourceforge.net> - 2017-01-20 10:19 -0800
    Re: Ignore missing data in the desired way u.gotzes@gmail.com - 2017-01-20 12:49 -0800
      Re: Ignore missing data in the desired way sfeam <sfeam@users.sourceforge.net> - 2017-01-21 16:26 -0800

#3543 — Ignore missing data in the desired way

Fromu.gotzes@gmail.com
Date2017-01-20 01:35 -0800
SubjectIgnore missing data in the desired way
Message-ID<4eb939ed-8e0f-45aa-a163-d1714b70536a@googlegroups.com>
Hi there,

I can't get the script below to do what I want, namely make gnuplot draw continuous lines between the respective datasets "Yes", "No" and "Maybe". Can anybody help?

Best
Uwe

#!/gnuplot
#
#    
#    	G N U P L O T
#    	Version 5.0 patchlevel 3    last modified 2016-02-21 
#    
#    	Copyright (C) 1986-1993, 1998, 2004, 2007-2016
#    	Thomas Williams, Colin Kelley and many others
#    
#    	gnuplot home:     http://www.gnuplot.info
#    	faq, bugs, etc:   type "help FAQ"
#    	immediate help:   type "help"  (plot window: hit 'h')
set terminal png
set output "out.png"
set datafile missing "?"
set style data points
set xdata time
set timefmt "%Y-%m-%d"
set xrange ["2017-01-01":"2017-01-09"]
set format x "%m/%d"
set timefmt "%Y-%m-%d"
#set table 'tmp.dat'
$data << EOD
Date	        Yes     No	Maybe
2017-01-01	?	9	?
2017-01-02	2	?	1
2017-01-03	3	7	?
2017-01-04	?	6	?
2017-01-05	5       5	9
2017-01-06	6       4	?
2017-01-07      7       ?	1
2017-01-08      ?       2	?
2017-01-09      9       1	5
EOD
plot "$data" using "Date":"Yes" w l, "$data" using "Date":"No" with steps, "$data" using "Date":"Maybe" smooth sbezier

[toc] | [next] | [standalone]


#3545

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2017-01-20 12:05 +0100
Message-ID<o5sqtt$ese$1@solani.org>
In reply to#3543
Am 20.01.2017 um 10:35 schrieb u.gotzes@gmail.com:
> 
> I can't get the script below to do what I want, namely make gnuplot draw continuous lines between the respective datasets "Yes", "No" and "Maybe". Can anybody help?
> 

(simplified example)
set dataf missing '?'
$dat << EOD
No Maybe
0 2
1 ?
2 1
3 2
4 ?
5 9
6 ?
? 1
8 2
9 5
EOD

plot "$dat" using "No":"Maybe" w lp # missing dp are invalid
pause -1
plot "$dat" using 1:2 w lp    # works



There are few connecting lines and no bezier curve, because an
invalid datapoint breaks those connections.

Aaand you know about that and "set datafile missing '?'", meaning
the connections should not be broken.

I find that it works if I use column numbers instead of header
strings in the "using" specifier. Looks like a bug to me.

[toc] | [prev] | [next] | [standalone]


#3546

FromEthan A Merritt <sfeam@users.sourceforge.net>
Date2017-01-20 10:19 -0800
Message-ID<o5tk9d$9f4$1@dont-email.me>
In reply to#3545
Karl Ratzsch wrote:

> Am 20.01.2017 um 10:35 schrieb u.gotzes@gmail.com:
>> 
>> I can't get the script below to do what I want, namely make gnuplot draw
>> continuous lines between the respective datasets "Yes", "No" and "Maybe".
>> Can anybody help?
>> 
> 
> (simplified example)
> set dataf missing '?'
> $dat << EOD
> No Maybe
> 0 2
> 1 ?
> 2 1
> 3 2
> 4 ?
> 5 9
> 6 ?
> ? 1
> 8 2
> 9 5
> EOD
> 
> plot "$dat" using "No":"Maybe" w lp # missing dp are invalid
> pause -1
> plot "$dat" using 1:2 w lp    # works
> 
> 
> 
> There are few connecting lines and no bezier curve, because an
> invalid datapoint breaks those connections.
> 
> Aaand you know about that and "set datafile missing '?'", meaning
> the connections should not be broken.
> 
> I find that it works if I use column numbers instead of header
> strings in the "using" specifier. Looks like a bug to me.

Version 5 was supposed to remove the difference between 
   using N    and   using ($N)
but it seems that this is a case where they are still treated
differently, as they were in earlier gnuplot versions.
So on the one hand it's always been this way, but on the other hand
it was intended to change. Let's call it a bug.

Note that using ($N) and using (column(N)) and using (column("head"))
all share the same input processing.  So this bug is not specific
to column headers.

[toc] | [prev] | [next] | [standalone]


#3547

Fromu.gotzes@gmail.com
Date2017-01-20 12:49 -0800
Message-ID<98179684-032d-464e-ab28-ba2bbd913555@googlegroups.com>
In reply to#3543
Thanks Karl and Ethan. I wrote a Ticket on https://sourceforge.net/p/gnuplot/bugs/1896/

[toc] | [prev] | [next] | [standalone]


#3548

Fromsfeam <sfeam@users.sourceforge.net>
Date2017-01-21 16:26 -0800
Message-ID<o60u3l$u3f$1@dont-email.me>
In reply to#3547
u.gotzes@gmail.com wrote:

> Thanks Karl and Ethan. I wrote a Ticket on
> https://sourceforge.net/p/gnuplot/bugs/1896/

A fix for your specific problem is now in cvs for both 5.0 and 5.1
There is now also a related command
   set datafile missing NaN
that tells gnuplot to treat any data point that evaluates to 
not-a-number as if it were missing altogether.  This change is
based on a suggestion and patch from Christoph Bersch.


   Ethan

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web