fix cross-device link error
[PyX.git] / test / functional / test_timeaxis.py
blob4aa6ec02b30f65e1156b44667c9df59aae414270
1 #!/usr/bin/env python
2 import sys; sys.path[:0] = ["../.."]
4 import time
5 from pyx import *
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")))
18 g.plot(d)
19 g.writeEPSfile("test_timeaxis")
20 g.writePDFfile("test_timeaxis")
21 g.writeSVGfile("test_timeaxis")