X-Git-Url: https://projects.mako.cc/source/matplotlib-cdsw/blobdiff_plain/0a6b1b4db717da540e57c15eb7506d2d8f75da58..7bd9bbbbb11d7585b76e63e354c0c779d5a8c547:/003-plot-timeseries.py diff --git a/003-plot-timeseries.py b/003-plot-timeseries.py new file mode 100644 index 0000000..ec98776 --- /dev/null +++ b/003-plot-timeseries.py @@ -0,0 +1,38 @@ +""" +003-plot-timeseries.py + +Plot data from the Harry Potter data-set as a time-series + +""" + + +import matplotlib.pyplot as plt +import load_hp_data as hp + +# We can play with styles: +#plt.style.use('bmh') +plt.style.use('ggplot') +# To see available styles, type: +#plt.style.available + +fig, ax = plt.subplots(1) +ax.plot(hp.columns['timestamp'], hp.columns['size']) +ax.set_xlabel('Time') +ax.set_ylabel('Size of the edit') + +plt.show() + + +# Challenge: plot the relationship between edit size. Use + +## Hint 1: + +#delta_time1 = hp.columns['timestamp'][1] - hp.columns['timestamp'][0] + +## Hint 2: + +# You can give `plt.plot` more arguments to control the shape/size/color +# of the markers used. For example, try: + +# ax.plot([1,2,3], [2,4,8], '.') +# ax.plot([1,2,3], [2,4,8], 'r.')