Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
matlablearner
matlablearner am 22 Okt. 2014
Beantwortet: Star Strider am 22 Okt. 2014
The above colors are default colors given by MATLAB. How can I change the blue and red colors to my choice of colors ?

Antworten (1)

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

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by