next up previous contents index
Next: PyGist 3D Graphics Up: PyGist 2D Graphics Previous: Example 1   Contents   Index


Example 2

The next example computes and plots a set of nested cardioids in the primary and secondary colors.

fma() 
x = 2 * pi * arange (200, typecode = Float) / 199.0 
for i in range (1, 7): 
r = 0.5 * i -(5 -0.5 * i) * cos (x) 
s = 'curve ' + `i` #Backticks produce something printable. 
plg (r * sin (x), r * cos (x), marks = 0, color = -4 -i, 
legend = s) # Curves unmarked, in colors.

2#2



Michiel Jan Laurens de Hoon 2003-04-19