function barplot_tops(cts, vts, lw, lt, cc)
%function clear_barplot2(cts, vts, lw, lt, cc)
%makes a clear barplot, to be superimposed on another bar plot (so we can
%show pdf under null, alt, etc.
%input:
%cts and vts: counts and bin centres, as the output of a hist()command
%lw: linewidth of the bar plot
%lt: line type, 1=='-' 
%               2=='--'
%               3==':'
%               4=='-.'
%              anything else=='-'
%cc: three element color descriptor
%
%PLOTTING will be on the current axis: mke sure it is correct.

% cts=count_raw2;
% vts=vec2;
% bw=0.8;
% lw=8;
% cc=[0,1,0];

if lt==1
    ttype='-';
elseif lt==2
    ttype='--';
elseif lt==3
    ttype=':';
elseif lt==4
    ttype='-.';
else
    ttype='-';
end

ins_good=find(cts~=0);
NN=length(ins_good);
offer=(vts(2)-vts(1))/2;

for PP=1:1:NN
    plot([vts(ins_good(PP))-offer, vts(ins_good(PP))+offer], [cts(ins_good(PP)), cts(ins_good(PP))], ['k', ttype], 'LineWidth', lw, 'Color', cc), hold on
    if ins_good(PP)>1
        plot([vts(ins_good(PP))-offer, vts(ins_good(PP))-offer], [cts(ins_good(PP)-1), cts(ins_good(PP))], ['k', ttype], 'LineWidth', lw, 'Color', cc), hold on
    else
        plot([vts(ins_good(PP))-offer, vts(ins_good(PP))-offer], [0, cts(ins_good(PP))], ['k', ttype], 'LineWidth', lw, 'Color', cc), hold on
    end
	
    if ins_good(PP)<length(vts)
        plot([vts(ins_good(PP))+offer, vts(ins_good(PP))+offer], [cts(ins_good(PP)+1), cts(ins_good(PP))], ['k', ttype], 'LineWidth', lw, 'Color', cc), hold on
    else
        plot([vts(ins_good(PP))+offer, vts(ins_good(PP))+offer], [0, cts(ins_good(PP))], ['k', ttype], 'LineWidth', lw, 'Color', cc), hold on
    end
end