def plot_trainingdata(self): count = self.trainingdata_count() fig, ax = PlotUtils.prepare_figure(len(count)) ax.bar(range(0, len(count)), count, width=0.7) ax.bar(range(0, len(count)), count, width=0.7) plt.ylabel(_("Number of training data")) return fig
def plot_y_stats(self): norm = self.y.norm() stdev = self.y.stdev_s() upper = [norm[i] + stdev[i] for i in range(0, len(stdev))] lower = [norm[i] - stdev[i] for i in range(0, len(stdev))] fig, ax = PlotUtils.prepare_figure(len(stdev)) [ ax.plot(self.y.data_by_year(year).values, label='individual years', color='blue', alpha=.2) for year in range(self.y.timeseries.index[0].year, self.y.timeseries.index[-1].year + 1) ] ax.plot(upper, color='black') ax.plot(lower, color='black', label="+/- STDEV") ax.plot(norm, label="NORM", color='red') handles, labels = ax.get_legend_handles_labels() ax.legend(handles[-3:], labels[-3:]) plt.ylabel(self.y.label) return fig