#Exercise 5.9 import numpy as np import matplotlib.pyplot as plt v0 = 10 g = 9.81 t_stop = 2*v0/g """ The standard numpy recipe for creating arrays with t and y values: """ t = np.linspace(0,t_stop,101) y = v0*t -0.5*g*t**2 #plot the curve plt.plot(t,y) #decorate the plot plt.xlabel('time (s)') plt.ylabel('height (m)') plt.title('Height of ball') #show the plot on the screen plt.show() """ Terminal> python plot_ball1.py (output is a plot) """