anyway to give separate color to 'stack' bar plot
조회 수: 3 (최근 30일)
이전 댓글 표시
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?
Thanks!
Yu
댓글 수: 0
답변 (1개)
darova
2019년 10월 16일
편집: darova
2019년 10월 16일
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
darova
2019년 10월 16일
I have v2013. Which face will change if you try this
hBar(1).FaceColor = [1 0 0];
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!