prevent double call of _cleanup, which harms usefiles (and is a bad idea in general)
[PyX.git] / www / png / example.py
blob82e63816079a64f2c3489579cbc99259a072aa24
1 import math
2 from pyx import *
4 class phasecolorsurface(graph.style.surface):
6 def midcolor(self, *c):
7 return math.atan2(sum([math.sin(x) for x in c]), sum([math.cos(x) for x in c]))
9 g = graph.graphxyz(size=3.5, zscale=0.3, projector=graph.graphxyz.central(3, 25, 8),
10 x=graph.axis.lin(painter=None),
11 y=graph.axis.lin(painter=None),
12 z=graph.axis.lin(painter=None),
13 x2=None, y2=None)
14 g.plot(graph.data.file("example.dat", x=1, y=2, z=3, color=4), [phasecolorsurface(gradient=color.rgbgradient.Rainbow, coloraxis=graph.axis.lin(min=-math.pi, max=math.pi), backcolor=color.rgb.black, keygraph=None)])
15 g.writeEPSfile("example")