def plot_timeseries(turbine, start, end, show = True):

    plt.clf()

    timeseries=turbine.get_measurements()
    d=np.array([m[0] for m in timeseries])
    y1=np.array([m[1] for m in timeseries]) #score
    y2=np.array([m[2] for m in timeseries]) #speed

    d_time = []
    for i in range (len(d)):
        d_act = datetime.datetime.fromtimestamp(d[i])
        d_time.append(d_act)
    plt.subplots_adjust(bottom=0.25)
    plt.xticks(rotation = 75)

    ax=plt.gca()
    xfmt = md.DateFormatter('%Y/%m/%d %H-h')
    ax.xaxis.set_major_formatter(xfmt)

    ax.grid(True)
    plt.ylim(-2, 32)
    plt.ylabel("Corrected Power (MW), Wind Speed (m/s)")
    plt.plot(d_time[start:end], y1[start:end], label = 'Power Production')
    plt.plot(d_time[start:end], y2[start:end], label = 'Wind Speed')
    plt.legend(loc='lower right')
    plt.title("Timeseries of the Selected Turbine")

    if(show):
        plt.show()
Plot windspeed and power production of a turbine
dataset/ETHPy150Open cigroup-ol/windml/windml/visualization/plot_timeseries.py/plot_timeseries