%peter_new.m

%NOTE: don't forget to make the "make104_...._image.m files

clear all; close all; fclose all;

colormap(cmap(1,100));         % make color map for -80 to -55 dB when
colmap=colormap;              % datrange = 1e-4 to 1e-8
%colmap=[colmap;ones(10,3)];   % add white for range -55 to -50dB
m=32;
g=[12:m-1]'/max(m-1,1);
g=1-g;
g=[g g g];
colmap=[colmap;g];            % add gray-scale for range -55 to -45dB
colmap=[colmap;zeros(20,3)];  % add black for range -45 to -40dB
colormap(colmap);
save colmap colmap -ascii
% datrange= max and min values for 10log(sv) data (Albatross IV data series)
datrange =[10*log10(1e-4) 10*log10(1e-10)]; %this sets range of color bar.
clegend5(datrange,'SV',.87);

filename='nbp103_152';
load (filename);

[r,c]=size(sv_1(:,8:end));

nplot=4;

bottom = 0.1; % start of bottom plot - window 0,0 to 1.0,1.0
left = 0.1;
step = 0.2;

for ic = 1:nplot

    switch ic
        case 1
            %%start here to move code to plotting program
            emat=sv_4;
            maxdepth=399;
            
            yaxlab=(0:1.0:399);
            
            plotfig

            xlabel('time(yrday)');
            ylabel('depth(m)');

            hold on;

            text(152.692, 321.664, '420 Khz','color','w','fontsize',[4]);

            drawnow
            
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        case 2

            ic=2;
            bottom = bottom+step;
            emat=sv_3;

            maxdepth=399;
            
            yaxlab=(0:1.0:399);
            
            plotfig

            text(152.692, 321.664, '200 Khz','color','w','fontsize',[4]);
            
            drawnow

            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        case 3
            ic=3;
            bottom = bottom+step;
            emat=sv_2;

            maxdepth=599;
            
            yaxlab=(0:1.5:599);
            
            plotfig

            text(152.692, 521.664, '120 Khz','color','w','fontsize',[4]);
            
            drawnow


            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        case 4
            ic=4;
            bottom = bottom+step;
            emat=sv_1;

            maxdepth=599;
            
            yaxlab=(0:1.5:599);
            
            plotfig

            text(152.692, 521.664, '43 Khz','color','w','fontsize',[4]);
            
            drawnow
    end
end
title('nbp0103\_152')

print -djpeg nbp103_152_all.jpg