function ssphere(r,ax)

% SSPHERE(R,AXIS) plots the 2D projections of a spehre (circles) with radius R in gray color on the walls of a 3D graph.
% AXIS is used for the function to know where to draw the curves
%
% Initial version: Magnus Billvik, Swedish Institute of Space Physics,
%Uppsala, June 2005

theta=(0:1:360);
[x,y] = pol2cart(theta*pi/180,r);

xmi=ax(1)*ones([1 length(x)]);
xma=ax(2)*ones([1 length(x)]);
ymi=ax(3)*ones([1 length(x)]);
yma=ax(4)*ones([1 length(x)]);
zmi=ax(5)*ones([1 length(x)]);
zma=ax(6)*ones([1 length(x)]);

col=[0.7 0.7 0.7];

hold on;

plot3(x, y, zmi, 'color', col);
plot3(x, yma, y, 'color', col);
plot3(xma, x, y, 'color', col);
