function out = plottb(tt,a)

% This plots an exposure/burial history on the figure generated by 
% plotGISPdata.m. 
% input arg is tt structure (see forwardTD.m for details).
% 
% 
% Greg Balco -- Berkeley Geochronology Center -- May 2016

% clean up
delete(findobj('tag','exphist'));

yy = [2.5 2.5 3 3 2.5];


% Get in right axes
axes(a);

% Plot complete exposure history length in blue
tt = tt./1000;

xx = [tt(1) 0 0 tt(1) tt(1)];
patch(xx,yy,[0.6 0.6 1],'tag','exphist','edgecolor','none');

% Plot each exposure period in red
t1 = fliplr(tt);
for a = 1:length(tt);
    % The first period from the present is always burial. So odd periods
    % are burial and even periods are exposure.
    if mod(a,2) == 0; % is even period
        xx = [t1(a) t1(a-1) t1(a-1) t1(a) t1(a)];
        %axes(a);
        patch(xx,yy,'r','tag','exphist','edgecolor','none');
    end;
end;
