summaryrefslogtreecommitdiff
path: root/leapsecond.py
diff options
context:
space:
mode:
authorSanjeev Gupta <ghane0@gmail.com>2015-05-01 23:40:31 +0800
committerGary E. Miller <gem@rellim.com>2015-05-07 14:21:00 -0700
commitcb72446fb6bd3d8d639a89209d71888d3b7d58bc (patch)
treefad7d0321f6a4a65db450f2fb2de05e2d0993627 /leapsecond.py
parent7c1a1f62b8755899184f57666099b8a818fa8156 (diff)
downloadgpsd-cb72446fb6bd3d8d639a89209d71888d3b7d58bc.tar.gz
Extend xrange, so that first and last points can be seen.
Else they lie on the border. Signed-off-by: Gary E. Miller <gem@rellim.com>
Diffstat (limited to 'leapsecond.py')
-rwxr-xr-xleapsecond.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/leapsecond.py b/leapsecond.py
index dff231da..c7d0b75f 100755
--- a/leapsecond.py
+++ b/leapsecond.py
@@ -297,6 +297,7 @@ def graph_history(filename):
(b, c, e) = leastsquares(zip(range(len(raw)), raw))
e /= (60 * 60 * 24 * 7)
dates = map(lambda t: time.strftime("%Y-%m-%d", time.localtime(t)), raw)
+ enddate = time.strftime("%Y-%m-%d", time.localtime(raw[-1]+16416000)) # Adding 190 days to scale
fmt = ''
fmt += '# Least-squares approximation of Unix time from leapsecond is:\n'
fmt += 'lsq(x) = %s * x + %s\n' % (b, c)
@@ -309,7 +310,7 @@ def graph_history(filename):
fmt += 'set timefmt "%Y-%m-%d"\n'
fmt += 'set xdata time\n'
fmt += 'set format x "%Y-%m-%d"\n'
- fmt += 'set xrange ["%s":"%s"]\n' % (dates[0], dates[-1])
+ fmt += 'set xrange ["%s":"%s"]\n' % ("1979-09-01", enddate)
fmt += 'set key left top box\n'
fmt += 'plot "-" using 3:1 title "Leap second inserted" with points ;\n'
for (i, (r, d)) in enumerate(zip(raw, dates)):