1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
k1=[1 2 3 4 5 5];
k2=[1 1 3 5];
a=hist(k1,[1:5]); % Création de tes histo
b=hist(k2,[1:5]);
x=1:5;
c=[a;b]';
h=bar3(c,'stack'); % Superposition des deux histo
t=get(h(1),'parent'); % Récupération des carac du graphe
set(t,'ytick',x);
set(t,'yticklabel',x)
set(t,'ylim',[0 6])
set(h(1),'facecolor',[0 0 0]); % Modification des couleurs
set(h(1),'edgecolor',[0 1 0]);
set(h(2),'facecolor',[1 0 0]); % Modification des contours
set(h(2),'edgecolor',[0 0 0]);
view(-90,0) % Passage en 2D |
Partager