monkey-patch for mathpazo bug
[PyX/mjg.git] / manual / rects.py
blob1594c1d5bccfca67dbc88c9dc532e5e2a351d07e
1 from pyx import *
3 c = canvas.canvas()
5 rect1 = path.path(path.moveto(0, 0), path.lineto(0, 1),
6 path.lineto(1, 1), path.lineto(1, 0),
7 path.lineto(0, 0))
9 rect2 = path.path(path.moveto(0, 0), path.lineto(0, 1),
10 path.lineto(1, 1), path.lineto(1, 0),
11 path.closepath())
13 c.stroke(rect1, [trafo.scale(2), style.linewidth.THICK])
14 c.text(1, -0.7, "not closed", [text.halign.center])
15 c.stroke(rect2, [trafo.scale(2).translated(4, 0), style.linewidth.THICK])
16 c.text(5, -0.7, "closed", [text.halign.center])
18 c.stroke(rect2, [trafo.scale(2).translated(8, 0), style.linewidth.THICK, deco.filled([color.grey(0.95)])])
19 c.text(9, -0.7, "filled", [text.halign.center])
21 c.writeEPSfile("rects", paperformat="a4")