File: log.py

package info (click to toggle)
pyx 0.11.1-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,468 kB
  • sloc: python: 18,575; ansic: 99; makefile: 91; sh: 9
file content (17 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import math
from pyx import *
from pyx.graph import axis

# we here use parters and texters which are explained in the examples below
log2parter = axis.parter.log([axis.parter.preexp([axis.tick.rational(1)], 4),
                              axis.parter.preexp([axis.tick.rational(1)], 2)])
log2texter = axis.texter.exponential(nomantissaexp=r"{2^{%s}}",
                                     mantissamax=axis.tick.rational(2))

g = graph.graphxy(width=10,
    x=axis.log(min=1, max=1024),
    y=axis.log(min=1, max=1024, parter=log2parter),
    y2=axis.log(min=1, max=1024, parter=log2parter, texter=log2texter))

g.writeEPSfile("log")
g.writePDFfile("log")