% Contour plots of the first nmax exponential sums (Figure 1)
%
h = 1/64;  nmax = 4;  bounds = [-3.25  .75  -3.375  3.375];
vabs0 = [0:.1:1];  vang0 = [-.875:.125:1]*pi;
x = bounds(1):h:bounds(2);  y=bounds(3):h:bounds(4);
a = ones(size(y'))*x + i*y'*ones(size(x));
%  Next line: a shorter way of generating a (more memory!)
%  [xx,yy]=meshgrid(x,y); a=xx+i*yy;
t = ones(size(a));  f = t;
for n = 1: nmax
   if n <= 2, vabs = vabs0; vang = vang0;
   elseif n == 3, vabs = [vabs0 .47140452]; vang = vang0;
   else vabs = [vabs0 .58882535 .27039477]; 
      vang = [vang0 1.48185376 -1.48185376]; 
   end;
   t = t.*a/n;  f = f + t;
   figure(n);  clf;  hold on;
   axis(bounds);  axis image;
   contour(x, y, abs(f), vabs);
   contour(x, y, angle(f), vang);
end;
% figure(n); print -deps fign;

