import ppgplot
import numpy
import math
 
# initialize ploting.
ppgplot.pgbeg("?",1,1)       # open ploting device
ppgplot.pgask(1)                 # wait for user to press a key before erasing.
ppgplot.pgswin(-10,10,-10,10)    # set axis ranges.
                         # label the plot.
ppgplot.pgiden()                 # put user-name and date on plot.
 
# calculate a suitable function.
f  = numpy.arange(0,2*math.pi,0.25)
fx = numpy.cos(f);
fy = numpy.sin(f);
 
for i in range(f.shape[0]):
    ppgplot.pgslw(i%10+1)           # set line-width
    ppgplot.pgsls(i%5+1)            # set line-style
    ppgplot.pgsci(i%15+1)           # set color-index
    ppgplot.pgarro(fx[i],fy[i],10*fx[i],10*fy[i])
 
#close the plot.
ppgplot.pgend()
