change the color of bar

조회 수: 1 (최근 30일)
Hassan
Hassan 2011년 12월 30일
*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일
  댓글 수: 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')

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

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by