change the color of bar

1 visualizzazione (ultimi 30 giorni)
Hassan
Hassan il 30 Dic 2011
*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)

Risposte (1)

Grzegorz Knor
Grzegorz Knor il 30 Dic 2011
  2 Commenti
Hassan
Hassan il 30 Dic 2011
thanks for the comment. i forgot to mention i want the bars as grouped.
Hassan
Hassan il 30 Dic 2011
bar(y(:,1),'r')
hold on
bar(y(:,2),'g')
hold on
bar(y(:,3),'b')

Accedi per commentare.

Categorie

Scopri di più su Dialog Boxes in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by