Advertisement
Guest User

Untitled

a guest
Mar 1st, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. %matplotlib inline
  2.  
  3. import matplotlib.pyplot as plt
  4. import numpy as np
  5.  
  6. data = np.loadtxt('facebook_combined_histogram.csv', delimiter=',', dtype=int)
  7.  
  8. x = [ i[0] for i in data ]
  9. y = [ i[1] for i in data ]
  10.  
  11. size = 50
  12.  
  13. hist, bins = np.histogram(y, bins=size)
  14.  
  15. width = 0.7 * (bins[1] - bins[0])
  16. center = (bins[:-1] + bins[1:]) / 2
  17. plt.bar(center, hist, align='center', width=width)
  18.  
  19. plt.show()
  20.  
  21. plt.plot(np.arange(size), hist, 'ro')
  22. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement