Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- print("Stress vs Strain Diagram Maker")
- xlist = [0]
- ylist = [0]
- points_to_graph = 0
- while points_to_graph < 4:
- points_to_graph = int(input("How many points you want to graph (at least 4) \n"))
- for x in range(points_to_graph):
- stress = float(input("Provide Stress for point {} \n".format(x+1)))
- strain = decimal(input("Provide Strain for point {} \n".format(x+1)))
- ylist.append(stress)
- xlist.append(strain)
- print(xlist)
- print(ylist)
- plt.plot(xlist, ylist)
- plt.ylabel('Stress')
- plt.xlabel('Strain')
- plt.axis([0,5.0, 0, 20])
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement