File talk:Leapsecond.ut1-utc.svg

Suggested simpler script
The disadvantage of this script is that you have to set the xrange in a less-natural format; the advantage is that it uses only the MJD field and not the more tricky Y-M-D fields.

Wrapper script
wget http://maia.usno.navy.mil/ser7/finals.all cut -c 8-15,58,59-68 --output-delimiter " " finals.all > finals-cut.txt grep "P" finals-cut.txt > finals-pred.txt grep "I" finals-cut.txt > finals-iers.txt gnuplot leapsecs.gnuplot

leapsecs.gnuplot
set xdata time set timefmt "%s" set format x "%Y" set xrange ["442126800":"1357362000"] set grid lt 3 lc 0 unset key set terminal svg set output 'Leapsecond.ut1-utc.svg' plot 'finals-iers.txt' using (($1-40587)*86400):3 w l lt 2 lc 2 title 'Measured', 'finals-pred.txt' using (($1-40587)*86400):3 w l lt 1 lc 1 title 'Predicted'

The interesting things here are that timefmt "%s" specifies Unix-time (seconds since 1970-01-01 00:00:00 UTC); the xrange is specified in these units (and yes, the quotes are necessary), and the X formula becomes ($4-40587)*86400 — 1970-01-01 is JD 40587, and 86400 seconds per day.