function splot3(x,y,z,ax)

% SPLOT3(X,Y,Z,AXIS) plots the 2D projections of (X,Y,Z) 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

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

col=[0.7 0.7 0.7];

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