[初学笔记]matlab的具体类型图形命令函, bar条形图

来源:互联网 发布:黑马淘淘商城源码 编辑:程序博客网 时间:2024/05/23 21:38

转自

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

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')




(2)some basic parameters as last blog

line width, line style, facecolor, edgecolor

bar width, bar layout, bar baseline,

c = load('count.dat');
Y = c(1:6,:);
figure
hArray = bar(Y);
set(hArray(2),'LineWidth',2,'EdgeColor','red');



(3) error bar

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





阅读全文
0 0
原创粉丝点击