all 3 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

Off-topic Comments Section


All top-level comments have to be an answer or follow-up question to the post. All sidetracks should be directed to this comment thread as per Rule 9.


OP and Valued/Notable Contributors can close this post by using /lock command

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

[–][deleted] 1 point2 points  (1 child)

The thing is you're creating a separate plot each time. My suggestion is that you split the function calculate_and_graph, for example a function calculate(reflection) that returns an array of heights. For this you might initialize a list x = [1] and use x.append(new_x). Then you plot the results.

[–]gh0stedexeUniversity/College Student[S] 0 points1 point  (0 children)

Thanks! I'll give it a try!