I'd be glad if you could help me in building a histogram with different color for each histogram bin.
Before asking, I've tried to define for loops and a matrix of colors, without succeding.
My problem is that T.ConstructionYear is a 1531 x 1 numeric vector, and I'd have a different color for each bin. I left auto mode for the number of bins choice.
I've also tried to write the function for just two bins.
Thanks in advance for the help.
h1 = histogram(T.ConstructionYear, 'FaceColor', 'b');
ylabel('Number of Bridges');
title('Distribution of Construction Year Data');