function scatcolorbar(range,cmap,label)

% plot colorbar generated by scatcolor.m

for i=2:length(range)
    yp = [range(i-1) range(i-1) range(i) range(i)];
    xp = [0 1 1 0];
    p = patch(yp,xp,cmap(i,:));
    set(p,'EdgeColor',cmap(i-1,:));
end; clear i xp yp;
set(gca,'xlim',[min(range) max(range)],'yticklabel',[]);
xlabel(label,...
    'fontweight','bold','fontsize',16);
end