Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %matplotlib inline
- import matplotlib.pyplot as plt
- import numpy as np
- data = np.loadtxt('facebook_combined_histogram.csv', delimiter=',', dtype=int)
- x = [ i[0] for i in data ]
- y = [ i[1] for i in data ]
- size = 50
- hist, bins = np.histogram(y, bins=size)
- width = 0.7 * (bins[1] - bins[0])
- center = (bins[:-1] + bins[1:]) / 2
- plt.bar(center, hist, align='center', width=width)
- plt.show()
- plt.plot(np.arange(size), hist, 'ro')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement