4 Plot data from the Harry Potter data-set as a time-series
9 import matplotlib.pyplot as plt
10 import load_hp_data as hp
12 # We can play with styles:
14 plt.style.use('ggplot')
15 # To see available styles, type:
18 fig, ax = plt.subplots(1)
19 ax.plot(hp.columns['timestamp'], hp.columns['size'])
21 ax.set_ylabel('Size of the edit')
26 # Challenge: Is edit size related to how long it's been since the last edit?
27 # => Plot the relationship between edit size and the time since the last edit:
29 ## Hint 1: the number of seconds between two edits is:
31 #delta_time1 = (hp.columns['timestamp'][1] - hp.columns['timestamp'][0]).total_seconds()
35 # You can give `plt.plot` more arguments to control the shape/size/color
36 # of the markers used. For example, try:
38 # ax.plot([1,2,3], [2,4,8], '.')
39 # ax.plot([1,2,3], [2,4,8], 'r.')
41 # And see online documentation here:
42 # http://matplotlib.org/api/pyplot_summary.html
43 # http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot