File: log.py

package info (click to toggle)
pyx3 0.16-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,880 kB
  • sloc: python: 22,065; ansic: 130; makefile: 93; sh: 8
file content (17 lines) | stat: -rw-r--r-- 616 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import fractions, 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.default(base=fractions.Fraction(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")
g.writeSVGfile("log")