[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] [PATCH 4/4] Extend xrange, so that first and last points
From: |
Sanjeev Gupta |
Subject: |
[gpsd-dev] [PATCH 4/4] Extend xrange, so that first and last points can be seen. |
Date: |
Fri, 1 May 2015 23:40:31 +0800 |
Else they lie on the border.
---
leapsecond.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/leapsecond.py b/leapsecond.py
index dff231d..c7d0b75 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)):
--
2.1.4
- [gpsd-dev] [PATCH 1/4] Change axis, time monotonic on X , leapsecond count on Y, Sanjeev Gupta, 2015/05/01
- [gpsd-dev] [PATCH 2/4] Leap seconds plotted as points., Sanjeev Gupta, 2015/05/01
- [gpsd-dev] [PATCH 3/4] Extend yrange, so that first and last points can be seen., Sanjeev Gupta, 2015/05/01
- [gpsd-dev] [PATCH 4/4] Extend xrange, so that first and last points can be seen.,
Sanjeev Gupta <=
- [gpsd-dev] Fwd: [PATCH 1/4] Change axis, time monotonic on X , leapsecond count on Y, Sanjeev Gupta, 2015/05/04