概述
bar
条形图,用法多种多样;
y = [75 91 105 123.5 131 150 179 203 226 249 281.5];
bar(y)
x = 1900:10:2000;
y = [75 91 105 123.5 131 150 179 203 226 249 281.5];
bar(x,y)
y = [75 91 105 123.5 131 150 179 203 226 249 281.5];
bar(y,0.4)%占可以使用空间的40%
y = [2 2 3; 2 5 6; 2 8 9; 2 11 12];
bar(y)
y = [2 2 3; 2 5 6; 2 8 9; 2 11 12];
bar(y,‘stacked’)
y = [1 2 3; 4 5 6];
ax1 = subplot(2,1,1);
bar(ax1,y)
ax2 = subplot(2,1,2);
bar(ax2,y,‘stacked’)
y = [75 91 105 123.5 131 150 179 203 226 249 281.5];
bar(y,‘r’)
y = [75 91 105 123.5 131 150 179 203 226 249 281.5];
bar(y,‘FaceColor’,[0 .5 .5],‘EdgeColor’,[0 .9 .9],‘LineWidth’,1.5)
y = [2 4 6; 3 4 5];
b = bar(y);
b(2).LineWidth = 2;
b(2).EdgeColor = ‘red’;
Y = [5, 4, 3, 5;
3, 6, 3, 1;
4, 3, 5, 4];
figure
hBars = bar(Y);
hBars(1).BaseValue = 2;%改变0的基准线到2;
hBaseline = hBars(1).BaseLine;
hBaseline.LineStyle = ‘:’;
hBaseline.Color = ‘red’;
hBaseline.LineWidth = 2;%画出一条红色点的基准线;
days = 0:5:35;
conc = [515,420,370,250,135,120,60,20];
temp = [29,23,27,25,20,23,23,27];
figure
[ax,hBar,hLine] = plotyy(days,temp,days,conc,‘bar’,‘plot’);%有条形图和折线图;
title(‘Trend Chart for Concentration’)
xlabel(‘Day’)
ylabel(ax(1),‘Temperature (^{o}C)’)
ylabel(ax(2),‘Concentration’)
hLine.LineWidth = 3;
hLine.Color = [0,0.7,0.7];
最后
以上就是现代皮皮虾为你收集整理的matlab画图指令bar详解的全部内容,希望文章能够帮你解决matlab画图指令bar详解所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复