If I understand the concept of a flow duration curve correctly, you just plot the flow as a function of the exceedence.
import numpy as np
import matplotlib.pyplot as plt
data = np.random.rayleigh(10,144)
sort = np.sort(data)[::-1]
exceedence = np.arange(1.,len(sort)+1) / len(sort)
plt.plot(exceedence*100, sort)
plt.xlabel("Exceedence [%]")
plt.ylabel("Flow rate")
plt.show()
From this you easily read that a flow rate of 11 or larger is expected 60% of the time.
In case there are several datasets one may use
fill_between
to plot them as a range.
import numpy as np; np.random.seed(42)
import matplotlib.pyplot as plt
data0 = np.random.rayleigh(10,144)
data1 = np.random.rayleigh(9,144)
data2 = np.random.normal(10,5,144)
data = np.c_[data0, data1, data2]
exceedence = np.arange(1.,len(data)+1) /len(data)
sort = np.sort(data, axis=0)[::-1]
plt.fill_between(exceedence*100, np.min(sort, axis=1),np.max(sort, axis=1))
plt.xlabel("Exceedence [%]")
plt.ylabel("Flow rate")
plt.grid()
plt.show()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…