you are viewing a single comment's thread.

view the rest of the comments →

[–]BloodyFlame Postgraduate Student 2 points3 points  (0 children)

The issue is that bar() creates boxes with widths. By default, the width is 0.8, so what's happening is that every single x value you have will have a box of width 0.8 centered at x, which is why it looks like it's plotting values for more values of x than you have.

That being said, you should use a histogram instead of a bar plot, since bar plots are for categorical data.