How can I change the color of every data set in a clustered bar graph?

1 回表示 (過去 30 日間)
matlablearner
matlablearner 2014 年 10 月 22 日
回答済み: Star Strider 2014 年 10 月 22 日
The above colors are default colors given by MATLAB. How can I change the blue and red colors to my choice of colors ?

回答 (1 件)

Star Strider
Star Strider 2014 年 10 月 22 日
This works:
d = 1./randi(10, 10, 2);
figure(1)
hb = bar(d)
set(hb(1), 'FaceColor', 'm')
set(hb(2), 'FaceColor', 'g')

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by