
ncol=64;
pause on;
clg;
subplot(111);

disp(' ')
disp('  ----------------------- ')
disp(' ')
disp('  Basic snaphot plotting ')
disp(' ')
disp('  ----------------------- ')
disp(' ')
disp(' ')
disp('  Warning ! ')
disp('  the snapshots may be slightly ')
disp('  distorted near the boundaries ')
disp('  because of the irregular grid ')
disp('  spacing ...')
disp(' ')

nx=input(' Give nx (nx+1, nx from FD sim.) ');
nz=input(' Give nz (nz+1, nz from FD sim.) ');
dir
files=input(' Give name of snaphot file (in single quotes) ');
disp(' Loading snaphot files ');
eval(['load -ascii ' files]);
snap=eval([files]);
ns=floor(length(snap)/(nx*nz));

disp(' Which colors for snapshots ')
disp(' 1) gray ')
disp(' 2) hsv')
disp(' 3) cool')
disp(' 4) hot')
disp(' 5) jet')
ans=input(' Which? ');
if ans==1, col='gray'; end
if ans==2, col='hsv'; end
if ans==3, col='cool'; end
if ans==4, col='hot'; end
if ans==5, col='jet'; end

%file=input(' Give file with x coordinates  ');
%eval(['load -ascii ' file]);
%x=eval([file]);
%file=input(' Give file with z coordinates  ');
%eval(['load -ascii ' file]);
%z=eval([file]);

rmax=max(snap);

disp(' ')
disp(sprintf(' %g snapshots will be displayed ... ',ns))
disp(' ')

j0=input(' First snap ');
jinc=input(' Snap inc ');

isnap=0;
for j=j0:jinc:ns;
isnap=isnap+1;
s=reshape(snap((j-1)*nz*nx+1:j*nz*nx),nz,nx);
s=32+s/max(max(s))*32;
%image(x,z,s),colormap(col),axis('equal'),axis('off'),
image(1:nx,1:nz,s),colormap(col),axis('equal'),axis('off'),
title(files),
disp(' Press any key to continue ')
pause
end

