Merge branch 'traffic-timeseries' of github.com:arokem/matplotlib-cdsw
[matplotlib-cdsw] / 004-plot-histogram.py
1 """
2 004-plot-histogram.py 
3
4 Plot a histogram of edit sizes 
5
6 """
7
8 import matplotlib.pyplot as plt 
9 import load_hp_data as hp
10
11 plt.style.use('ggplot')
12
13 fig, ax = plt.subplots(1)
14 ax.hist(hp.columns['size'], bins=1000)
15 ax.set_xlabel('Size of the edit')
16 ax.set_ylabel('')
17 ax.set_title('Edit size distribution')
18
19 # Maybe don't really need that axis to be so long:
20 # ax.set_xlim([0, 200000])
21 plt.show()
22
23 ## Challenge : A 'mega-user' is a user with more than 1000 edits. 
24 # Plot a bar chart with the maximal edit size for each one of the mega-users

Benjamin Mako Hill || Want to submit a patch?