查看Matlab中关于条形图的示例。您可以使用一组钢筋或堆叠的钢筋,但我想您需要的是一组钢筋。我是这里的一个例子。
示例:bar(...)
用于获取所需结果的类型。考虑以下代码,结果如下所示:
% Make some play data:
x = randn(100,3);
[y, b] = hist(x);
% You can plot on your own bar chart:
figure(82);
bar(b,y,'grouped');
title('Grouped bar chart');
% Consider stack for the other type:
figure(83);
bar(b,y,'stacked');
title('Stacked bar chart');
您也可以使用hist(...)
:
% Bust histogram will work here:
figure(44);
hist(x);
title('Histogram Automatically Grouping');
更新
您可以通过合并两个条形图的数据来绘制单个条形图。您可以根据需要设置x轴值。请参阅此示例。要设置轴值Bar graph
,您可以观看此视频教程。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句