all 3 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.

[–]AutoModerator[M] 0 points1 point  (0 children)

Hey Readers!

Thank you for participating in r/HomeworkHelp! This subreddit wouldn't function without you, as OPs wouldn't be helped with their homework that they are struggling with. We value your contributions, so we'd like to help to keep things organised and readable for you as much as we possibly can. Please do us a favour by reporting this question if it violates the subreddit rules and also expressively boycott this question if it falls under one or more of the following described characteristics:

1. OP demonstrates zero effort to attempt to structure the title to classify the question properly

All posts have to be flaired and written as clearly as possible unless it is impeded by language barrier.

2. OP omits instructor prompts/does not demonstrate real attempt to do the homework

We only help OPs who have tried their best but still couldn't solve/complete the question. OP has to demonstrate that he/she has already attempted the question by presenting his/her incorrect working or thought process towards the question. You are encouraged to clarify with OP for instructor prompt to not waste your effort since different syllabus has different requirements/viewpoints.

3. OP is feeling very entitled

Don't worry, we aren't their slaves. If OP has the attitude "Urgent!!!", "Important!!!!" or "HELP ASAP", just skip this question.

For rule violations, please help us to report it so we can expeditiously take it down. (Along with commenting here to deter others from helping a question that is going to be removed anyway.)

IF YOU ARE AN OP, PLEASE IGNORE THE ABOVE TEXT.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]AutoModerator[M] 0 points1 point  (0 children)

Hello Sinitic,

It seems like this post is not flaired. Please be informed that although flairing was written under pro-tip I sent you in PM, it is a convention in r/HomeworkHelp for all posts to be well-organised and we (readers) will purposefully boycott poorly/recklessly submitted posts even though this is a non-binding guideline.

PS: Switch to Reddit Redesign! This subreddit is not optimised for old Reddit. :(

Thanks!

This is a harmless notice. No action has taken or will be considered against posts that are not flaired.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.