Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Chris Elvidge Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Missing points in multi line plot not being omitted Date: Thu, 8 Mar 2018 20:40:41 +0000 Organization: A noiseless patient Spider Lines: 97 Message-ID: References: <97425965-67e4-4299-a0e5-54e6d70e5789@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 8 Mar 2018 20:40:43 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="9e0d417f68aee4ba62dbd94bb871aff0"; logging-data="26593"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jRL9R4+IldEOktVH45l1cT7m8Hsm5C1M=" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 In-Reply-To: Content-Language: en-GB Cancel-Lock: sha1:kZ4QwC9pM5ILh3KixdPEkFXasWw= Xref: csiph.com comp.graphics.apps.gnuplot:3907 On 08/03/2018 07:10 pm, 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. > > I have tried the following, based on your first example, and it works > with Gnuplot 5.0 patchlevel 5 on Debian stretch. > > 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 > 2018-03-07:12:53:00 12 18 > 2018-03-07:11:53:00 12 ? > 2018-03-07:10:53:00 12 23 > 2018-03-07:09:53:00 20 28 > 2018-03-07:08:53:00 17 ? > 2018-03-07:07:53:00 13 23 > 2018-03-07:06:53:00 15 28 > 2018-03-07:05:53:00 15 29 > 2018-03-07:04:53:00 17 26 > 2018-03-07:02:53:00 9 ? > 2018-03-07:01:53:00 12 ? > 2018-03-07:00:53:00 16 ? > 2018-03-06:23:53:00 16 24 > 2018-03-06:22:53:00 16 29 > 2018-03-06:21:53:00 13 22 > 2018-03-06:20:53:00 15 22 > 2018-03-06:19:53:00 14 21 > 2018-03-06:18:53:00 13 20 > 2018-03-06:17:53:00 10 17 > 2018-03-06:16:53:00 10 ? > 2018-03-06:15:53:00 7 ? > 2018-03-06:14:53:00 12 ? > 2018-03-06:13:53:00 12 ? > e > 2018-03-07:12:53:00 12 18 > 2018-03-07:11:53:00 12 ? > 2018-03-07:10:53:00 12 23 > 2018-03-07:09:53:00 20 28 > 2018-03-07:08:53:00 17 ? > 2018-03-07:07:53:00 13 23 > 2018-03-07:06:53:00 15 28 > 2018-03-07:05:53:00 15 29 > 2018-03-07:04:53:00 17 26 > 2018-03-07:02:53:00 9 ? > 2018-03-07:01:53:00 12 ? > 2018-03-07:00:53:00 16 ? > 2018-03-06:23:53:00 16 24 > 2018-03-06:22:53:00 16 29 > 2018-03-06:21:53:00 13 22 > 2018-03-06:20:53:00 15 22 > 2018-03-06:19:53:00 14 21 > 2018-03-06:18:53:00 13 20 > 2018-03-06:17:53:00 10 17 > 2018-03-06:16:53:00 10 ? > 2018-03-06:15:53:00 7 ? > 2018-03-06:14:53:00 12 ? > 2018-03-06:13:53:00 12 ? > e > That's OK then. -- Chris Elvidge, England