在matlab中减小条形图的宽度

时间:2014-05-30 01:52:36

标签: matlab

我编写下面的代码来制作条形图,但问题是条的宽度非常大,我需要使宽度更薄,当我从图形属性更改它时整个图形变得更小..有什么帮助吗?

original photo

after modifying the width and the whole graph become smaller which i don't need that to happen

x = [2,3,4,5,6];
y = [80.32,95.2,92.6,75.6,65.7]
figure;
bar(x,y,'b');

1 个答案:

答案 0 :(得分:4)

您可以使用bar的第三个输入参数来指定宽度:

bar(x,y,.4,'b'); %// change ".4" as needed