gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] Fwd: [PATCH 1/4] Change axis, time monotonic on X , leapsecon


From: Sanjeev Gupta
Subject: [gpsd-dev] Fwd: [PATCH 1/4] Change axis, time monotonic on X , leapsecond count on Y
Date: Mon, 4 May 2015 23:27:06 +0800

Hi, could you please review and apply this (and 2...4/4).

--
Sanjeev Gupta
+65 98551208     http://www.linkedin.com/in/ghane

---------- Forwarded message ----------
From: Sanjeev Gupta <address@hidden>
Date: Fri, May 1, 2015 at 11:40 PM
Subject: [PATCH 1/4] Change axis, time monotonic on X , leapsecond count on Y
To: address@hidden
Cc: Sanjeev Gupta <address@hidden>


---
 leapsecond.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/leapsecond.py b/leapsecond.py
index f287510..60e478e 100755
--- a/leapsecond.py
+++ b/leapsecond.py
@@ -24,7 +24,7 @@ Options:

   -v be verbose

-  -g generate a plot of the leap-second trend over time. The command you
+  -g generate a plot of leap-second dates over time. The command you
      probably want is something like (depending on if your gnuplot install
      does or does not support X11.

@@ -302,15 +302,16 @@ def graph_history(filename):
     fmt += 'lsq(x) = %s * x + %s\n' % (b, c)
     fmt += '# Maximum residual error is %.2f weeks\n' % e
     fmt += 'set autoscale\n'
-    fmt += 'set xlabel "Leap second offset"\n'
-    fmt += 'set xrange [0:%d]\n' % (len(dates) - 1)
-    fmt += 'set ylabel "Leap second date"\n'
+    fmt += 'set ylabel "Leap second offset"\n'
+    fmt += 'set yrange [0:%d]\n' % (len(dates) - 1)
+    fmt += 'set xlabel "Leap second date"\n'
+    fmt += 'set xtics rotate by 300\n'
     fmt += 'set timefmt "%Y-%m-%d"\n'
-    fmt += 'set ydata time\n'
-    fmt += 'set format y "%Y-%m-%d"\n'
-    fmt += 'set yrange ["%s":"%s"]\n' % (dates[0], dates[-1])
+    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 key left top box\n'
-    fmt += 'plot "-" using 1:3 title "Leap-second trend" with linespoints ;\n'
+    fmt += 'plot "-" using 3:1 title "Leap-second trend" with linespoints ;\n'
     for (i, (r, d)) in enumerate(zip(raw, dates)):
         fmt += "%d\t%s\t%s\n" % (i, r, d)
     fmt += 'e\n'
--
2.1.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]