from Double Fourier Series Surface Plotting by Howard Wilson
Double Fourier series plots and effects of the number of terms and oscillation smoothing are shown.

range=getaxis(x,y,f1,f2)
function range=getaxis(x,y,f1,f2)
% range=getaxis(x,y,f1,f2)
xmin=min(x(:)); xmax=max(x(:)); 
ymin=min(y(:)); ymax=max(y(:));
fmin=min([f1(:);f2(:)]); fmax=max([f1(:);f2(:)]);
range=[xmin,xmax,ymin,ymax,fmin,fmax];

Contact us at files@mathworks.com