赞
踩
- Y = [5,2,1
- 8,7,3
- 9,8,6
- 5,5,5
- 4,3,2];
- figure
- bar(Y)
- figure
- bar(Y,'stacked')
- Y = [5,2,1
- 8,7,3
- 9,8,6
- 5,5,5
- 4,3,2];
- figure
- barh(Y)
- Y = [5,2,1
- 8,7,3
- 9,8,6
- 5,5,5
- 4,3,2];
- figure
- bar3(Y)
- figure
- bar3(Y,'stacked')
- Y = [5,2,1
- 8,7,3
- 9,8,6
- 5,5,5
- 4,3,2];
- figure
- bar3h(Y)
- Y = [5, 4, 3, 5;
- 3, 6, 3, 1;
- 4, 3, 5, 4];
- b = bar(Y);
b(1).BaseValue = 2;
- b(1).BaseLine.LineStyle = ':';
- b(1).BaseLine.Color = 'red';
- b(1).BaseLine.LineWidth = 2;
- x = [1 2 3 4 5];
- temp_high = [37 39 46 56 67];
- w1 = 0.5;
- bar(x,temp_high,w1,'FaceColor',[0.2 0.2 0.5])
- temp_low = [22 24 32 41 50];
- w2 = .25;
- hold on
- bar(x,temp_low,w2,'FaceColor',[0 0.7 0.7])
- hold off
- grid on
- ylabel('Temperature (\circF)')
- legend({'Average High','Average Low'},'Location','northwest')
- ax = gca;
- ax.XTick = [1 2 3 4 5];
- ax.XTickLabels = {'January','February','March','April','May'};
- ax.XTickLabelRotation = 45;
- x = 1:13;
- data = [37.6 24.5 14.6 18.1 19.5 8.1 28.5 7.9 3.3 4.1 7.9 1.9 4.3]';
- errhigh = [2.1 4.4 0.4 3.3 2.5 0.4 1.6 0.8 0.6 0.8 2.2 0.9 1.5];
- errlow = [4.4 2.4 2.3 0.5 1.6 1.5 4.5 1.5 0.4 1.2 1.3 0.8 1.9];
- bar(x,data)
- hold on
- er = errorbar(x,data,errlow,errhigh);
- er.Color = [0 0 0];
- er.LineStyle = 'none';
- hold off
- Z = magic(5);
- b = bar3(Z);
- colorbar
- for k = 1:length(b)
- zdata = b(k).ZData;
- b(k).CData = zdata;
- b(k).FaceColor = 'interp';
- end
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。