~ubuntu-branches/ubuntu/trusty/pyx/trusty

« back to all changes in this revision

Viewing changes to examples/drawing/pathitem.py

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2006-11-26 14:04:53 UTC
  • mfrom: (2.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20061126140453-1dq3cycpspmlik2t
Tags: 0.9-3
* New maintainer. Thank you for more than three years of
  maintenance,  Graham! Closes: #400087
* Don't hard-code python 2.3 in manual/Makefile.
  Thanks to Matthias Klose for the bug report and patch.
  Closes: #392634
* Remove obsolete dh_python call from debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from pyx import *
 
2
 
 
3
c = canvas.canvas()
 
4
 
 
5
rect1 = path.path(path.moveto(0, 0), path.lineto(1, 0),
 
6
                  path.moveto(1, 0), path.lineto(1, 1),
 
7
                  path.moveto(1, 1), path.lineto(0, 1),
 
8
                  path.moveto(0, 1), path.lineto(0, 0))
 
9
rect2 = path.path(path.moveto(2, 0), path.lineto(3, 0),
 
10
                  path.lineto(3, 1), path.lineto(2, 1),
 
11
                  path.lineto(2, 0))
 
12
rect3 = path.path(path.moveto(4, 0), path.lineto(5, 0),
 
13
                  path.lineto(5, 1), path.lineto(4, 1),
 
14
                  path.closepath())
 
15
 
 
16
c.stroke(rect1, [style.linewidth.THICK])
 
17
c.stroke(rect2, [style.linewidth.THICK])
 
18
c.stroke(rect3, [style.linewidth.THICK])
 
19
 
 
20
c.writeEPSfile("pathitem")
 
21
c.writePDFfile("pathitem")