How can I change color in barh graph

How can I change colors (blue and yellow as defualt) to any other colors in barh graph in Matlab?

 Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 24 Jun. 2015

0 Stimmen

You modify the 'FaceColor' of the bar:
h = barh(rand(4,2),'stacked')
h(1).FaceColor = 'r'; % color
h(2).FaceColor = [0.3 0.78 0.1];% rgb

Weitere Antworten (0)

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange

Gefragt:

Moe
am 24 Jun. 2015

Kommentiert:

Moe
am 24 Jun. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by