add UnicodeEngine (MultiEngineText and axis texters returning MultiEngineText), texte...
[PyX.git] / test / functional / test_timeaxis.py
blob70e04d85352ae5a1f2fb809c5ea6d2c43541a0ed
1 #!/usr/bin/env python
2 import sys; sys.path[:0] = ["../.."]
4 import time, datetime
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")