def plot_pdf_fit(self, label=None):
import matplotlib.pyplot as plt
from scipy.stats import exponweib, rayleigh
from scipy import linspace, diff
plt.bar(self.pdf[1][:len(self.pdf[0])], self.pdf[0], width=diff(self.pdf[1]), label=label, alpha=0.5, color='k')
x = linspace(0, 50, 1000)
plt.plot(x, exponweib.pdf(x, a=self.weibull_params[0], c=self.weibull_params[1], scale=self.weibull_params[3]), 'b--', label='Exponential Weibull pdf')
plt.plot(x, rayleigh.pdf(x, scale=self.rayleigh_params[1]), 'r--', label='Rayleigh pdf')
plt.title('Normalized distribution of wind speeds')
plt.grid()
plt.legend()
评论列表
文章目录