anyway to give separate color to 'stack' bar plot
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi:
I read an post from link below:
which provide a way to add annotation to the individual of each data. I would like to know if there is anyway to control the color of each individual bar?
![untitled.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/242936/untitled.jpeg)
Thanks!
Yu
0 Kommentare
Antworten (1)
darova
am 16 Okt. 2019
Bearbeitet: darova
am 16 Okt. 2019
Do you have colors you want to paint bars into?
for i = 1:length(hBar)
h1 = get(hBar(i),'Children');
n = length( get(h1,'FaceVertexCdata') );
set(h1,'faceVertexCdata',rand(n,3))
end
5 Kommentare
darova
am 16 Okt. 2019
I have v2013. Which face will change if you try this
hBar(1).FaceColor = [1 0 0];
Siehe auch
Kategorien
Mehr zu Annotations 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!