matlab画柱状图

来源:互联网 发布:淘宝上的游戏解封 编辑:程序博客网 时间:2024/05/03 12:01
原文地址:matlab画柱状图作者:雪后DE阳光

  论文中需要画图进行比较,感觉还是matlab画起来比较方便,先把自己画的图及matlab代码放上。

   y=[300311;390 425; 312 321; 250 185; 550 535; 420 432; 410 520;];
   b=bar(y);
   gridon;
   ch =get(b,'children');
  set(gca,'XTickLabel',{'0','1','2','3','4','5','6'})
   set(ch,'FaceVertexCData',[1 01;0 0 0;])
  legend('基于XXX的算法','基于YYY的算法');
   xlabel('x axis ');
   ylabel('y axis');

[转载]matlab画柱状图
下面是在网上看到的一些关于matlab柱状图的相关信息:

原文地址:matlab画柱状图[zz]作者:wjybit

记录一下matlab画柱状图。

 

从问题分类任务的算法比较中抽出。


-------------------------------------------------------------------

data = [1.0, 1.0, 0.565,0.508,0.481,0.745];
b = bar(data);
ch = get(b,'children');
set(ch,'FaceVertexCData',[4;2;3;1;5;6])
%set(gca,'XTickLabel',{'Sinaall','Sinatravel','S&S','x','mi'})
%set(gca,'XTickLabel',{'Sinaall','Sinatravel','S&S','STM','CHI','MI'})
set(gca,'XTickLabel',{'SVM(TF)','SVM(TFIDF)','Bayes','Rocchio(TF)','Rocchio(TFIDF)','类文档排名分类'})

axis([0 70.0 1.0]) 

%%%

ylabel('microF-measure');

-------------------------------------------------------------------


[转载]matlab画柱状图[zz]


--------------------------------------------------------------------------------------


data = [20.457,45.578;12.016,22.422];
b = bar(data);

ch = get(b,'children');

set(gca,'XTickLabel',{'训练过程','测试过程'})

legend('基于类文档排名的分类算法','结合bigram的类文档排名分类算法');

ylabel('所用时间(单位:秒)');


--------------------------------------------------------------------------------------


[转载]matlab画柱状图[zz]

MatlabBar图如何为每个bar设置不同颜色?

MatlabBar图如何为每个bar设置不同颜色?

20090515星期五 15:39

Matlab中很容易创建Bar图:

data = [3, 7, 5, 2;4, 3, 2, 9;6, 6, 1,4];
b = bar(data);

 

 

[转载]matlab画柱状图

 

Matlab中如何让Bar图的每一个Bar颜色不同?
下面是一个例子:
[转载]matlab画柱状图


data = [3, 7,5, 2;4, 3, 2, 9;6, 6, 1, 4];
b = bar(data);
ch = get(b,'children');
set(ch{1},'FaceVertexCData',[1;1;1;1;2;2;2;2;3;3;3;3;4;4;4;4])
set(ch{2},'FaceVertexCData',[1;1;1;1;2;2;2;2;3;3;3;3;4;4;4;4])
set(ch{3},'FaceVertexCData',[1;1;1;1;2;2;2;2;3;3;3;3;4;4;4;4])
set(ch{4},'FaceVertexCData',[1;1;1;1;2;2;2;2;3;3;3;3;4;4;4;4])

解释:
[1;1;1;1;2;2;2;2;3;3;3;3;4;4;4;4]
是要设置的颜色,要更改这里的颜色,既可以使用Indexed,也可以使用TrueColor,详见FaceVertexCDatahelp文档。

 

 


[转载]matlab画柱状图


data = [3, 7, 5, 2];
b = bar(data);
ch = get(b,'children');
set(ch,'FaceVertexCData',[0 0 1;0 1 1;1 1 1;1 01;])

 

0 0
原创粉丝点击