Hello
I want to create a 2D- bar graph and Color the bars depending on their values in gray tones. That is what I have so far:
figure()y = rand(10,1)*3-1.5;x = linspace(start, end, size(y));b=bar(x,y,1);% Defining Colormap
cm=gray(size(y));colormap(cm);set(get(b,'children'),'cdata', y);
But this does not work. Neither:
set(get(b,'children'),'CData', y);
I am missing something. Any help?
MJ
Best Answer