1 # Certainly logarithmic axes are supported in PyX. By playing with
2 # partitioners and texters, you can easily change the base.
4 # It is left as an exercise to the reader to create a automatic
5 # partitioner for logarithmic axes with base 2.
9 from pyx
.graph
import axis
11 p
= path
.curve(0, 0, 3, 0, 1, 4, 4, 4)
13 log2parter
= axis
.parter
.log([axis
.parter
.preexp([axis
.tick
.rational(1)], 4),
14 axis
.parter
.preexp([axis
.tick
.rational(1)], 2)])
15 log2texter
= axis
.texter
.exponential(nomantissaexp
=r
"{2^{%s}}",
16 mantissamax
=axis
.tick
.rational(2))
19 c
.insert(axis
.pathaxis(p
, axis
.log(min=1, max=1024)))
20 c
.insert(axis
.pathaxis(p
.transformed(trafo
.translate(4, 0)),
21 axis
.log(min=1, max=1024, parter
=log2parter
)))
22 c
.insert(axis
.pathaxis(p
.transformed(trafo
.translate(8, 0)),
23 axis
.log(min=1, max=1024, parter
=log2parter
,