change the color of bar

*I want to assign a secific color to each column ('r','g' and 'b'). I also want to show the bars as grouped. Any suggestion please? *
y=rand(9,3)
bar(y)

답변 (1개)

Grzegorz Knor
Grzegorz Knor 2011년 12월 30일

0 개 추천

댓글 수: 2

Hassan
Hassan 2011년 12월 30일
thanks for the comment. i forgot to mention i want the bars as grouped.
Hassan
Hassan 2011년 12월 30일
bar(y(:,1),'r')
hold on
bar(y(:,2),'g')
hold on
bar(y(:,3),'b')

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2011년 12월 30일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by