File: parter.py

package info (click to toggle)
pyx 0.9-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,060 kB
  • ctags: 2,665
  • sloc: python: 15,205; makefile: 142; ansic: 131
file content (14 lines) | stat: -rw-r--r-- 490 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import math
from pyx import *

p = path.curve(0, 0, 3, 0, 1, 4, 4, 4)

myparter = graph.axis.parter.linear(["1/3", "1/6"])

c = canvas.canvas()
c.insert(graph.axis.pathaxis(p, graph.axis.linear(min=0, max=1, parter=myparter)))
c.insert(graph.axis.pathaxis(p.transformed(trafo.translate(4, 0)),
                             graph.axis.linear(min=0, max=1, parter=myparter,
                             texter=graph.axis.texter.rational())))
c.writeEPSfile("parter")
c.writePDFfile("parter")