'''
Retrieve three days' forecast of New York City and create a graph
Using https://github.com/csparpa/pyowm
'''
import matplotlib.pyplot as plt
from pyowm import OWM

owm = OWM('54c5451fcc146ce043f4f44153e4ea4b')

def get_forecast(city):
    # https://github.com/csparpa/pyowm/issues/266
    fc = owm.three_hours_forecast(city)
    f = fc.get_forecast()
    
    # three_hours_forecast() returns 5 day forecast at a granularity
    # of three hours
    # we plot them all
    weathers = f.get_weathers()
    
    
    data_points = ['temp', 'temp_max', 'temp_min', 'temp_kf']
    temp = []
    for w in weathers:
        forecast_temp = w.get_temperature('celsius')
        #for point in data_points:
        temp.append(forecast_temp['temp'])
    x = range(1, len(temp)+1)
    plt.plot(x, temp, 'o-')
    #plt.xticks(x, day_intervals)
    plt.show()

if __name__ == '__main__':
    get_forecast('new york, us')

@@ -164,52 +164,39 @@
 OWM%0A
-%0Aowm = OWM('54c5451fcc146ce043f4f44153e4ea4b
+import pytz%0A%0Aowm = OWM('%3Ctoken%3E
 ')%0A%0A
@@ -571,16 +571,35 @@
 mp = %5B%5D%0A
+    date_time = %5B%5D%0A
     for 
@@ -678,34 +678,257 @@
     
-#for point in data_points:
+utc_dt = datetime.utcfromtimestamp(w.get_reference_time()).replace(tzinfo=pytz.utc)%0A        tz = pytz.timezone('America/New_York')%0A        dt = utc_dt.astimezone(tz)%0A%0A        # print it%0A        date_time.append(dt.strftime('%25Y-%25m-%25d %25H:%25M:%25S %25Z%25z'))
 %0A   
@@ -1029,17 +1029,16 @@
 -')%0A    
-#
 plt.xtic
@@ -1049,19 +1049,15 @@
 , da
-y_intervals
+te_time
 )%0A  

Update nyc_forecast_owm.py