% colormapdisplay
% usage: colormapdisplay(map)
% show the color components and greyscale average of a color map  
% map is the color map of an iamge 

function colormapdisplay(map);
[m,n] = size(map);
R = map(:,1);
G = map(:,2);
B = map(:,3);
% K = map*[1;1;1]/3; straight average
K = map*[.3;.6;.1]; % numbers use in color television versus black and white
I = 1:m;
plot(I,R,'-r',I,G,'-g',I,B,'-b',I,K,'-k'); 