set(gca,'NextPlot','add','Box','on', ... 'XLim', [x1 x2], ... 'YDir','reverse', ... 'YLim',[z1 z2]);
fillcolor = [0 0 0]; linecolor = [0 0 0]; linewidth = 0.1;
z=z'; % input as row vector zstart=z(1); zend =z(nz);
for i=1:nx,
if trmx(i) ~= 0; % skip the zero traces tr=a(:,i); % --- one scale for all section s = sign(tr) ;
i1= find( s(1:nz-1) ~= s(2:nz) ); % zero crossing points npos = length(i1);
/7/97
zadd = i1 + tr(i1) ./ (tr(i1) - tr(i1+1)); %locations with 0 amplitudes aadd = zeros(size(zadd));
[zpos,vpos] = find(tr >0);
[zz,iz] = sort([zpos; zadd]); % indices of zero point plus positives aa = [tr(zpos); aadd]; aa = aa(iz);
% be careful at the ends
if tr(1)>0, a0=0; z0=1.00; else, a0=0; z0=zadd(1); end;
if tr(nz)>0, a1=0; z1=nz; else, a1=0; z1=max(zadd); end;
zz = [z0; zz; z1; z0]; aa = [a0; aa; a1; a0];
zzz = zstart + zz*dz -dz;
patch( aa+x(i) , zzz, fillcolor);
line( 'Color',[1 1 1],'EraseMode','background', ...
'Xdata', x(i)+[0 0], 'Ydata',[zstart zend]); % remove zero line
%'LineWidth',linewidth, ...
/7/97 'Xdata', x(i)+[0 0], 'Ydata',[z0 z1]*dz); % remove zero line
line( 'Color',linecolor,'EraseMode','background', ... 'LineWidth',linewidth, ...
'Xdata', tr+x(i), 'Ydata',z); % negatives line
else % zeros trace
line( 'Color',linecolor,'EraseMode','background', ... 'LineWidth',linewidth, ...
'Xdata', [x(i) x(i)], 'Ydata',[zstart zend]); end; end;