SMH
SMH

Reputation: 1316

decreasing the width of bar graph in matlab

I wrote the code below to make a bar graph but the problem is that the width of the bar is very big and i need to make the width thinner, when i change it from the fig properties the whole graph become smaller .. any help?

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

Upvotes: 1

Views: 1404

Answers (1)

Luis Mendo
Luis Mendo

Reputation: 112689

You can use a third input argument to bar which specifies width:

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

Upvotes: 4

Related Questions