Guest User

Untitled

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