close all;


n = 30;   % plots a 2n by n grid on the surface of the sphere
[xc,yc] = meshgrid(linspace(-3,1,2*n+1), linspace(-1,1,n+1));
[xp,yp,zp] = mapc2m(xc,yc);

% we want the sphere to be centered in a square figure box, not
% a rectangular one.  Size doesn't matter so much.  Only
% means we may end up scaling the figure differently in Latex file.
set(gcf,'paperposition',[0 0 6 6]);

% we want to be able to fill up the figure box, if necessary.
% i.e. we don't  want any extra space around the sphere.
ha = axes('position',[0 0 1 1]);
surf(ha,xp,yp,zp);

colormap([1 1 1]);
daspect([1 1 1])

% finally, we want to be able to adjust the size of the sphere
% relative to the size of the figure box.
% Larger view angle --> the sphere takes up less space
% Smaller view angle --> fills up the figure box.
set(gca,'cameraviewanglemode','manual');
set(gca,'cameraviewangle',7);

axis off
ht = camlight;
