How to plot a histogram with two different bar colours
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Emmanuel Matata Bili Bili
am 6 Dez. 2020
Kommentiert: Emmanuel Matata Bili Bili
am 9 Dez. 2020
Hi,
I have a histogram and I want to have two seperate bar colours and then add a legend for both colours.
I have tried different solutions but no luck. Any assistance would be appreciated. My code is below.
I'm extracting data from a table with categorical data. The data is in the 11th column of the table.
My current histogram

BB = T3{:,11}
histogram(BB,'FaceColor','g' )
legend
0 Kommentare
Akzeptierte Antwort
Mario Malic
am 6 Dez. 2020
Bearbeitet: Mario Malic
am 6 Dez. 2020
Hello,
Reference to the answer by Mike is here. If you could display your data with bar function, it is possible to set the color of each individual element with CData property.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!