prevent double call of _cleanup, which harms usefiles (and is a bad idea in general)
[PyX.git] / examples / graphs / join.py
blobbcd2d503d67e6dacffb6ac1f56769a43e52dff5a
1 from pyx import *
3 g = graph.graphxy(width=8, key=graph.key.key())
5 As = [0.3, 0.6, 0.9]
7 d = [graph.data.join([graph.data.function("y_a(x_a)=A*sin(2*pi*x_a)", context=dict(A=A)),
8 graph.data.file("join.dat", x_b=1, y_b=i+2)],
9 title=r"$A=%g$" % A)
10 for i, A in enumerate(As)]
12 attrs = [color.gradient.RedBlue]
14 g.plot(d,
15 [graph.style.pos(usenames=dict(x="x_a", y="y_a")),
16 graph.style.line(attrs),
17 graph.style.pos(usenames=dict(x="x_b", y="y_b")),
18 graph.style.symbol(graph.style.symbol.changesquare, symbolattrs=attrs, size=0.1)])
20 g.writeEPSfile()
21 g.writePDFfile()
22 g.writeSVGfile()