horizontal bar graphs/ figures
Afficher commentaires plus anciens
how do i plot specific colours with a barh graph. i can plot specific colours for the first stacked bar graph but not for the second as h =barh... only produces 'h' values for the first stacked bar graph. Any help would be appreciated. Thx
MJ_Green= 50;
MJ_Yellow= 5;
MJ_Red=25;
MN_Yellow =5;
MN_Green=25;
MN_Red=50;
Red_time_both= 2;
%
Phasing_ALL = [MJ_Green, MJ_Yellow, MJ_Red, Red_time_both ; MN_Red, MN_Green, MN_Yellow, Red_time_both];
h = barh(Phasing_ALL,0.5,'stacked');
xlabel('Seconds','FontSize',12);
set(gca,'yticklabel',{'Major Road','Minor Road'});
set(h(1),'Facecolor','g');
set(h(2),'Facecolor','y');
set(h(3),'Facecolor','r');
set(h(4),'Facecolor','m');
need to set colours for second bar also.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Annotations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!