Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- TITLE = 'Time (Per Minute) Vs Num of Requests Graph'
- X_AXIS_NAME = 'TimeStamps (per minute)'
- Y_AXIS_NAME = 'No. of Requests'
- time_stamp = ['06:02', '06:03', '06:12', '06:16', '06:17', '06:27', '06:28',
- '06:30', '06:31', '06:34', '06:35', '06:36', '06:37', '06:38', '06:39',
- '06:40', '06:41', '06:42', '06:43', '06:44', '06:45', '06:46', '06:47',
- '06:48', '06:49', '06:50', '06:51', '06:52', '06:53', '06:54', '06:55',
- '06:56', '06:57', '06:58', '06:59', '07:00', '07:01']
- requests = [74, 20, 2, 1, 11, 9, 34, 3, 5, 4, 28, 77, 75, 73]
- fig, ax = plt.subplots()
- plt.plot(time_stamp, requests)
- fig.autofmt_xdate()
- plt.xlabel(X_AXIS_NAME)
- plt.ylabel(Y_AXIS_NAME)
- plt.title(TITLE)
- plt.show()
- fig.savefig('graph.png', dpi=fig.dpi)
Add Comment
Please, Sign In to add comment