Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- t = np.linspace(0, 40, 1000) # start, finish, n points
- d_r = 2.5 * t
- d_s = 3 * (t-5)
- plt.title('A Bank Robber Caught')
- plt.xlabel('time (in minutes)')
- plt.ylabel('distance (in km)')
- fig, ax = plt.subplots()
- ax.set_xlim([0, 40])
- ax.set_ylim([0, 100])
- ax.plot(t, d_r, c='green')
- ax.plot(t, d_s, c='brown')
- plt.axvline(x=30, color='purple', linestyle='--')
- _ = plt.axhline(y=75, color='purple', linestyle='--')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement