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)

Respuestas (1)

Grzegorz Knor
Grzegorz Knor el 30 de Dic. de 2011

0 votos

2 comentarios

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

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 30 de Dic. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by