function clr=scalecolormap(data)
%scale line color
% clr = scalescolormap(data)
% input vector data with length ndata
% output clr(1:ndata,1:3) is an array describing colormap jet scaled by
% data vector
% scalecolormap.m
%C. Roesler, November 2008

map=colormap(jet);
lmap=length(map);

ndata=length(data);
mindata=min(data);,maxdata=max(data);,xrange=(maxdata-mindata);
for i=1:ndata
    indx(i,1)=ceil(64*(data(i)-mindata)/(xrange));,
end
I=find(indx<=0);,indx(I,1)=1;
    clr=map(indx,:);
