From 24eedc7a37a5312686e816c940a90051ab5a81a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rg=20Lehmann?= Date: Sun, 29 Aug 2004 19:35:36 +0000 Subject: [PATCH] various fixes to examples due to new normpath constructor git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@1842 069f4177-920e-0410-937b-c2a4a81bcd90 --- examples/circles.py | 10 +++++----- examples/graphs/integral.py | 2 +- examples/graphs/partialfill.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/circles.py b/examples/circles.py index 9ef8d959..6abc1c29 100644 --- a/examples/circles.py +++ b/examples/circles.py @@ -1,16 +1,16 @@ from pyx import * -circ1 = path.normpath(path.circle(0, 0, 1)) # you don't really need normpath, -circ2 = path.normpath(path.circle(1, 1, 1)) # but its better to have it once - # for those operations +circ1 = path.circle(0, 0, 1).normpath() # you don't really need normpath, +circ2 = path.circle(1, 1, 1).normpath() # but its better to have it once + # for those operations (circ1a, circ1b), (circ2a, circ2b) = circ1.intersect(circ2) intersection = (circ1.split([circ1a, circ1b])[0] << circ2.split([circ2b, circ2a])[0]) -intersection.append(path.closepath()) +intersection[-1].close() union = (circ1.split([circ1a, circ1b])[1] << circ2.split([circ2b, circ2a])[1]) -union.append(path.closepath()) +union[-1].close() c = canvas.canvas() c.fill(union, [color.rgb.blue]) diff --git a/examples/graphs/integral.py b/examples/graphs/integral.py index e38e6449..0b9be901 100644 --- a/examples/graphs/integral.py +++ b/examples/graphs/integral.py @@ -22,7 +22,7 @@ pb = g.xgridpath(b) area = (pa.split([splitpa])[0] << p.split([splita, splitb])[1] << pb.split([splitpb])[0].reversed()) -area.append(path.closepath()) +area[-1].close() g.stroke(area, [deco.filled([color.gray(0.8)])]) g.text(g.pos(0.5 * (a + b), 0)[0], 1, r"\int_a^b f(x){\rm d}x", [text.halign.center, text.mathmode]) diff --git a/examples/graphs/partialfill.py b/examples/graphs/partialfill.py index 044a6928..c042b0e2 100644 --- a/examples/graphs/partialfill.py +++ b/examples/graphs/partialfill.py @@ -11,8 +11,8 @@ horiz = g.plot(graph.data.function("y=0.5*x", points=2)) g.finish() # convert paths to normpaths (for efficiency reasons only) -fline = path.normpath(fline.styledata.path) -horiz = path.normpath(horiz.styledata.path) +fline = fline.styledata.path.normpath() +horiz = horiz.styledata.path.normpath() # intersect the lines splith, splitf = horiz.intersect(fline) @@ -25,7 +25,7 @@ area = area.joined(fline.split([splitf[-2], splitf[-1]])[1]) area = area.joined(horiz.split([splith[-1]])[1]) area.append(path.lineto(*g.vpos(1, 0))) area.append(path.lineto(*g.vpos(0, 0))) -area.append(path.closepath()) +area[-1].close() c = canvas.canvas() -- 2.11.4.GIT