function a=plot_spheres(xc,yc,zc,col,rad)

% function a=plot_spheres(xc,yc,zc,color,radius)
% funtion to plot small spheres carrying scalar information
% program designed to describe a probability in a 3D model space
% applicable to inverse problems (e.g. hypocenter location
% xc,yc,zc, - coordinates of sphere centers
% color     - vector containing value to plot (e.g. temperature, probability)
% radius    - radius of spheres (constant)


n=100; % nhumber of faces for sphere

[x,y,z]=sphere(n);
color=(x)*0;
ns=length(xc);

% loop through spheres



for i=1:ns,
   
   surf(rad*x+xc(i),rad*y+yc(i),rad*z+zc(i),color+col(i)), 
   caxis([min(col) max(col)]); axis equal; axis off; shading interp; 
   hold on
   
end
light
hold off
