Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?J=c3=b6rg_Buchholz?= Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Missing points in multi line plot not being omitted Date: Sat, 10 Mar 2018 10:57:47 +0100 Organization: A noiseless patient Spider Lines: 79 Message-ID: References: <52fd232c-59cd-44b7-bbb3-5b4c52d4bd76@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 10 Mar 2018 09:57:48 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="b9af9a289d1573757f038dff1d0ea971"; logging-data="23845"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19n0GtdLGsRvBSb/tTGed4u/WNaYEPyeHc=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 In-Reply-To: Content-Language: en-GB Cancel-Lock: sha1:nC4+XAGD5f5BHP3a1/ZOLEcBN4I= Xref: csiph.com comp.graphics.apps.gnuplot:3911 On 10.03.2018 08:18, Ethan A Merritt wrote: > Jörg Buchholz wrote: > >> On 09.03.2018 19:48, Marius Schamschula wrote: >> >>> >>> FYI, I'm using version 5.2 patchlevel 2 under FreeBSD, so indeed >>> there should not be any quotes around the NaN >>> >>> Dealing with single points is easy: add a marker. My problem is >>> having lines where they shouldn't be. >>> >> I have compiled the 5.2.2 Version and it confuse me. >> >> set style data linespoints >> set datafile missing NaN >> plot '-' u 1:2 >> input data ('e' ends) > 1 10 >> input data ('e' ends) > 2 20 >> input data ('e' ends) > 3 NaN >> input data ('e' ends) > 4 40 >> input data ('e' ends) > 5 50 >> input data ('e' ends) > e >> >> There is no gap in the output. > > Correct. There is no gap because the NaN point is treated as missing. > From the docs under "help missing" > > "invalid data causes a gap in a line drawn through sequential > data points; missing data does not." > > >> unset datafile missing NaN >> plot '-' u 1:2 >> input data ('e' ends) > 1 10 >> input data ('e' ends) > 2 20 >> input data ('e' ends) > 3 NaN >> input data ('e' ends) > 4 40 >> input data ('e' ends) > 5 50 >> input data ('e' ends) > e >> >> There is a gap between 2 - 4 in the output. > > Yes, because now the point is not "missing". It is "invalid". > >> In the 5.2 Documentation there are some examples for the "set datafile >> missing option". Only the examples with "NaN" direct in the data gives >> a gap. > > Correct. > >> So can you put a "NaN" into your data? >> >> IMHO the 5.0 Version works nicer, or more than I expected. Or is it a >> bug? > >> Jörg > > Perhaps a misunderstanding. Let me try re-phrasing... > > "Missing" data acts as if no entry at that x coordinate was present > in the data file at all, so it has no effect on the line being drawn. > > A gap in the line indicates that data at that x coordinate was present, > but invalid. > > The special command "set datafile missing NaN" tells the program > to treat invalid data as if it were missing (no gap). > > Ethan > Thanks for your explanation. So it was a misunderstanding. But the behave from gnuplot 5.0 is nice and easy to handle. So for gnuplot 5.2 the only solution is something like "sed -i 's/?/NaN/g' datafile.dat" before plotting the data or in a pipe? Jörg