I have a vector of 2026 integers with each entry taking a value between 0 and 11. I make a simple bar chart and I want the color of each bar to vary according to its height (value 0 to 11) for example according to a linear colormap between blue and red. I have tried to do this in the colormap editor by selecting a colormap with an appropriate gradient and changing the "color data min" and "color data max" to 0 and 11 respectively, but the bars always appear to be the same color. I think the problem may be that I'm not using a three dimensional set of data?
MATLAB: I simply want the colors of bars in a bar graph to depend on the y value.
color bar graph
Best Answer