Don't plot missing data in a timeseries line plot

Don't plot missing data in a timeseries line plot

Post by Andy Lough » Sat, 03 Feb 2001 08:50:49



Hello,

I have timeseries data from Jan 1 - Jan 31, one observation per day.
There are 6-7 days of no data, but in a line plot of the data, gnuplot
merrily extrapolates across those days of missing data to the next day
which contains data.

I would prefer that the line plot have NO LINES across days of missing
data, and that the lines simply begin again where the data are valid.

Can this be done?

--
Andrew Loughe =====================================================

325 Broadway             |  wwweb: www-ad.fsl.noaa.gov/users/loughe
Boulder, CO  80305-3328  |  phone: 303-497-6211   fax: 303-497-6301

 
 
 

Don't plot missing data in a timeseries line plot

Post by Hans-Bernhard Broeke » Tue, 06 Feb 2001 22:12:04



> Hello,
> I have timeseries data from Jan 1 - Jan 31, one observation per day.
> There are 6-7 days of no data, but in a line plot of the data, gnuplot
> merrily extrapolates across those days of missing data to the next day
> which contains data.
> I would prefer that the line plot have NO LINES across days of missing
> data, and that the lines simply begin again where the data are valid.
> Can this be done?

Yes, but easily only by changing the datafile. The background is that
gnuplot does not try to make assumptions about your data. In
particular, it doesn't assume that timeseries, or any other data, must
come at evenly spaced intervals (like exactly one datapoint per day).

So what you'll have to do is add explicit 'missing' datapoints for the
days that don't have actual data. See 'help missing' for some details.

--

Even if all the snow were burnt, ashes would remain.

 
 
 

1. plotting 2 timeseries data files on one plot with pre3.6/pl273

I'm using gnuplot pre 3.6/pl 273 to plot 2 data files containing
time series data on the same plot.  Both data files have a simple
2 column format - column 1 has the date as mm/dd/yy, and column 2
has a value as n.nnn.

I would like only the y axis marked for the first data file, and
only the y2 axis marked for the second data file (the x data is
identical in both files.)  I tried the following:

 set xdata time
 set timefmt "%m/%d/%y"
 set ytics nomirror
 set y2tics
 plot "t1.dat" using 1:2 with linespoint, second, \
  "t2.dat" using 1:2 with linespoint

The plot axes are marked perfectly, but only the first data file
is plotted correctly.  The second plot is incorrectly drawn as
a vertical line right in the middle, with the following error
message: Warning: empty x range [1:1], adjusting to [0.9:1.1]

Here is some sample data that produces the above error:
t1.dat                  t2.dat
1/15/95 38.000          1/15/95 3.000
1/16/95 37.375          1/16/95 4.375
1/17/95 36.938          1/17/95 5.938
1/18/95 36.750          1/18/95 6.750
1/19/95 37.250          1/19/95 7.250

Note that the second plot is drawn correctly if I change the
xdata to plain data instead of time.  Clues anyone ?
--

Goldman, Sachs & Co. [NYP/46]    Phone: +1 212 357 1346

2. centering thanks

3. Don't draw line for missing data

4. FAQ request

5. plotting with missing data points

6. converting from 3DS?

7. Plotting "missing" data

8. UV Seam

9. contour plot and grid data missing some points

10. plot with missing data

11. Plot with missing Data

12. Pixel Plot to Line Plot algorithm.