How can I change the color of every data set in a clustered bar graph?
2 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/145827/image.jpeg)
The above colors are default colors given by MATLAB. How can I change the blue and red colors to my choice of colors ?
0 个评论
回答(1 个)
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')
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!