2 import sys
; sys
.path
[:0] = ["../.."]
6 from pyx
.graph
.axis
import timeaxis
7 from pyx
.graph
import data
9 d
= data
.file("data/timedata", date
=1, value
=2)
10 d
= data
.points([[datetime
.datetime(*(time
.strptime(date
)[:6])), value
] for date
, value
in zip(d
.columns
["date"], d
.columns
["value"])], x
=1, y
=2)
12 g
= graph
.graphxy(height
=5, x
=timeaxis
.timeaxis(manualticks
=[timeaxis
.timetick(2003, 8, 12),
13 timeaxis
.timetick(2003, 8, 13),
14 timeaxis
.timetick(2003, 8, 14),
15 timeaxis
.timetick(2003, 8, 15),
16 timeaxis
.timetick(2003, 8, 16)],
17 texter
=timeaxis
.timetexter("%d %b")))
19 g
.writeEPSfile("test_timeaxis")
20 g
.writePDFfile("test_timeaxis")
21 g
.writeSVGfile("test_timeaxis")