1. 程式人生 > >Matlab程式畫柱狀圖

Matlab程式畫柱狀圖

一、源程式

Y = round(rand(5,3)*10);
figure;
subplot(2,2,1);
bar(Y,'grouped');
title('Group')
subplot(2,2,2);
bar(Y,'stacked');
title('Stack')
subplot(2,2,3);
bar(Y,'histc');
title('Histc')
subplot(2,2,4);
bar(Y,'hist');
title('Hist')

二、效果