rename texmessage.loadfd to texmessage.loaddef and allow for .def and .fd files
[PyX/mjg.git] / examples / axis / manualticks.py
blob91d65b14faa674c2a9d8a4915eddce3df71e846b
1 # Ticks can be set manually in combination with automatically created
2 # ticks. Note that the rating takes into account the manual ticks as
3 # well.
5 import math
6 from pyx import *
7 from pyx.graph import axis
9 p = path.curve(0, 0, 3, 0, 1, 4, 4, 4)
11 myticks = [axis.tick.tick(math.pi, label="\pi", labelattrs=[text.mathmode]),
12 axis.tick.tick(2*math.pi, label="2\pi", labelattrs=[text.mathmode])]
14 c = canvas.canvas()
15 c.insert(axis.pathaxis(p, axis.linear(min=0, max=10)))
16 c.insert(axis.pathaxis(p.transformed(trafo.translate(4, 0)),
17 axis.linear(min=0, max=10, manualticks=myticks)))
18 c.writeEPSfile("manualticks")
19 c.writePDFfile("manualticks")