|
1 | 1 | import matplotlib.pyplot as plt |
2 | | -from w_helpers import load_data, aggregate_by_day, extract_day_of_hourly |
| 2 | +from w_helpers import load_data, aggregate_by_day, extract_day_of_hourly, label_date |
3 | 3 |
|
4 | 4 | import uuid |
5 | 5 |
|
6 | | -datasource = 'ornl' |
| 6 | +datasource = 'central_park' |
7 | 7 |
|
8 | 8 | temperature = load_data(datasource) |
9 | | -temperature = temperature[temperature['year'] >= 2016] |
| 9 | +temperature = temperature[temperature['year'] >= 2017] |
10 | 10 | temperature_daily = aggregate_by_day(temperature) |
11 | 11 |
|
12 | 12 |
|
13 | 13 | class RowPrinter: |
14 | 14 | def __init__(self, ln, df, picker=10): |
15 | 15 | ln.set_picker(picker) |
| 16 | + # we can use this to ID our line! |
16 | 17 | self.uid = str(uuid.uuid4()) |
17 | 18 | ln.set_gid(self.uid) |
18 | 19 | self.ln = ln |
@@ -44,18 +45,18 @@ def remove(self): |
44 | 45 | ax.set_xlabel('Date [UTC]') |
45 | 46 | ax.set_ylabel('Air Temperature [℃]') |
46 | 47 | ax.set_title(f'{datasource} temperature') |
| 48 | + |
47 | 49 | rp = RowPrinter(ln, temperature_daily) |
48 | 50 |
|
49 | | -one_day = extract_day_of_hourly(temperature, 2015, 10, 18) |
| 51 | +one_day = extract_day_of_hourly(temperature, 2017, 10, 27) |
50 | 52 | plt.show() |
51 | 53 |
|
52 | 54 | # EXERCISE |
53 | 55 | # - make the print out nicer looking |
54 | 56 |
|
55 | 57 | # - open a new window with plot of day temperature |
56 | 58 | # - fig, ax = plt.subplots() |
57 | | -# - one_day = extract_day_of_hourly(bwi, 2015, 10, 18) |
58 | | - |
59 | | - |
| 59 | +# - one_day = extract_day_of_hourly(temperature, 2015, 10, 18) |
60 | 60 | # - make picking add a label with `label_data` |
61 | | -# - use `get_gid` to filter instead of `is not` |
| 61 | + |
| 62 | +# - use `get_gid` to filter artists instead of `is not` |
0 commit comments