3d function plots
[PyX/mjg.git] / examples / axis / log.py
blob999ab97b1b9e65f4fd17cad6b8631b8db091af57
1 import math
2 from pyx import *
3 from pyx.graph import axis
5 p = path.curve(0, 0, 3, 0, 1, 4, 4, 4)
7 log2parter = axis.parter.log([axis.parter.preexp([axis.tick.rational(1)], 4),
8 axis.parter.preexp([axis.tick.rational(1)], 2)])
9 log2texter = axis.texter.exponential(nomantissaexp=r"{2^{%s}}",
10 mantissamax=axis.tick.rational(2))
12 c = canvas.canvas()
13 c.insert(axis.pathaxis(p, axis.log(min=1, max=1024)))
14 c.insert(axis.pathaxis(p.transformed(trafo.translate(4, 0)),
15 axis.log(min=1, max=1024, parter=log2parter)))
16 c.insert(axis.pathaxis(p.transformed(trafo.translate(8, 0)),
17 axis.log(min=1, max=1024, parter=log2parter,
18 texter=log2texter)))
19 c.writeEPSfile("log")
20 c.writePDFfile("log")