File: test_unit.py

package info (click to toggle)
pyx3 0.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,328 kB
  • sloc: python: 27,656; makefile: 225; ansic: 130; sh: 17
file content (19 lines) | stat: -rwxr-xr-x 522 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
import sys; sys.path[:0] = ["../.."]

from pyx import *
from pyx.path import *

c=canvas.canvas()

unit.set(uscale=1)
c.stroke(path(moveto(0,0), lineto(unit.u_cm+unit.t_cm, unit.u_cm)), [color.rgb.red])
unit.set(uscale=2)
c.stroke(path(moveto(0,0), lineto(unit.u_cm+unit.t_cm, unit.u_cm)), [color.rgb.green])
unit.set(uscale=4)
c.stroke(path(moveto(0,0), lineto(unit.u_cm+unit.t_cm, unit.u_cm)), [color.rgb.blue])

c.writeEPSfile("test_unit")
c.writePDFfile("test_unit")
c.writeSVGfile("test_unit")