Matlab--画柱状图

画柱状图

矩阵的一列为一组,每一行的颜色相同.

%data

%1 2
%4 5
%2 3
data = [1,2;4,5;2,3];
b = bar(data);
ch = get(b,'children');
set(gca,'XTickLabel',{'第一行','第二行','第三行'});   %横坐标每行的标号( 1 2、4 5、2 3三行)。
legend('第一列','第二列');    

 image

posted @ 2014-01-16 14:50  helloweworld  阅读(3159)  评论(0编辑  收藏  举报