histogram bins with different colors
Show older comments
Hello Everybody,
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');
xlabel('ConstructionYear');
ylabel('Number of Bridges');
title('Distribution of Construction Year Data');
Accepted Answer
More Answers (1)
Giuseppe Degan Di Dieco
on 4 May 2021
Edited: Giuseppe Degan Di Dieco
on 4 May 2021
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

