summaryrefslogtreecommitdiff
path: root/leapsecond.py
diff options
context:
space:
mode:
authorSanjeev Gupta <ghane0@gmail.com>2015-05-01 23:40:28 +0800
committerGary E. Miller <gem@rellim.com>2015-05-07 14:20:52 -0700
commita3a501e73c589f826b8bdd6fda8ce86f67db4eb2 (patch)
treeb9d3fed8413eb13fd8619ad097262e06d624e15d /leapsecond.py
parentd6d606e4ddb3dd3f293fef4a98a5b656fffe19e4 (diff)
downloadgpsd-a3a501e73c589f826b8bdd6fda8ce86f67db4eb2.tar.gz
Change axis, time monotonic on X , leapsecond count on Y
Signed-off-by: Gary E. Miller <gem@rellim.com>
Diffstat (limited to 'leapsecond.py')
-rwxr-xr-xleapsecond.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/leapsecond.py b/leapsecond.py
index f2875101..60e478ea 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'