4 class rgbgradient(color
.lineargradient
):
7 return color
.lineargradient
.getcolor(self
, x
).rgb()
9 rgbHue
= rgbgradient(color
.hsb(0, 1, 1), color
.hsb(1, 1, 1))
11 class phasecolorsurface(graph
.style
.surface
):
13 def midcolor(self
, *c
):
14 return math
.atan2(sum([math
.sin(x
) for x
in c
]), sum([math
.cos(x
) for x
in c
]))
16 g
= graph
.graphxyz(size
=3.5, zscale
=0.3, projector
=graph
.graphxyz
.central(3, 25, 8),
17 x
=graph
.axis
.lin(painter
=None),
18 y
=graph
.axis
.lin(painter
=None),
19 z
=graph
.axis
.lin(painter
=None),
21 g
.plot(graph
.data
.file("example.dat", x
=1, y
=2, z
=3, color
=4), [phasecolorsurface(gradient
=rgbHue
, backcolor
=color
.rgb
.black
)])
22 g
.writeEPSfile("example")