转自
http://www.cnblogs.com/vanker/p/4245315.html
matlab help document
1 二维图形的函数命令
bar 长条图
scatter 散点图
pie 饼图
errorbar 图形加上误差范围
countour 等高线图
fplot 较精确的函数图形
polar 极座标图
hist 累计图
rose 极座标累计图
stairs 阶梯图
stem 针状图
fill 实心图
feather 羽毛图
Compass 罗盘图
quiver 向量场图
2 条形图 bar
在matlab中 help bar,有更详细的回答
(1) bar graph style
命令函数 barlayout
subplot(2,2,1);
bar(Y,'grouped');
title('Group')
bar(Y,'stacked');
bar(Y,'histc');
title('Histc')
bar(Y,'hist');
title('Hist')
(2)some basic parameters as last blog
line width, line style, facecolor, edgecolor
bar width, bar layout, bar baseline,
Y = c(1:6,:);
hArray = bar(Y);
set(hArray(2),'LineWidth',2,'EdgeColor','red');
x = linspace(0,2*pi,30);
y = sin(x);
e = std(y)*ones(size(x));
errorbar(x,y,e)
其中e 就是已知的误差值
(4)set baseline, bar handle
matlab中 help barseries properities
命令函数
bar_handle = bar(randn(10,1));
baseline_handle = get(bar_handle,'BaseLine');
set(baseline_handle,'LineStyle','--','Color','red')
(5) 反向bar图 用 命令函数 barh
即x y 坐标的位置跟上面的相反
(6)三维的条形图
bar3
barh3