grp.next() for nm in onset.columns: plt.plot(years, onset[nm], label=labels[nm], **styles[nm]) plt.legend(fontsize=9, loc="upper left", ncol=2) plt.grid() plt.xlim(min(years) - 1, max(years) + 1) plt.xticks(xticks, xticklabels) plt.xlabel("Year") plt.ylabel("Day of Year") plt.title("Onset") # Yearly timeseries of retreat and length for ind, nm in zip([retreat, length], ["Retreat", "Length"]): grp.next() plt.plot(years, ind, **styles[onset_nm]) plt.grid() plt.xticks(xticks, xticklabels) plt.xlim(min(years) - 1, max(years) + 1) plt.xlabel("Year") plt.title(nm) # Histograms pos = (0.05, 0.68) for ind, flag in zip([onset[onset_nm], retreat, length], [True, True, False]): grp.next() indices.plot_hist(ind, pos=pos, incl_daystr=flag) if grp.col == 0: plt.ylabel("# Occurrences") else: plt.ylabel("")
'CHP_MFC', 'CHP_PCP'] shortkeys_sub = [short[key] for key in keys_sub] n = len(keys_sub) fig, axes = plt.subplots(n, 2, figsize=(10,14), sharex='col') plt.subplots_adjust(left=0.08, right=0.95, wspace=0.2, hspace=0.3) plt.suptitle('Onset Day Indices') for i, key in enumerate(shortkeys_sub): ind = ind_comp[key] ax1, ax2 = axes[i, 0], axes[i, 1] ind.plot(ax=ax1) ax1.set_ylabel('Day') ax1.set_title(key, fontsize=12) if i == len(shortkeys_sub) - 1: ax1.set_xlabel('Year') indices.plot_hist(ind.values, binwidth=5, ax=ax2) if i < len(shortkeys_sub) - 1: ax2.set_xlabel('') ax2.set_ylabel('# Years') saveclose('onset_yrs_', isave, exts) # ---------------------------------------------------------------------- # Daily timeseries together key_onset = 'HOWI_100' d_onset = index[key_onset]['onset'].values # keys_list = [['HOWI_100', 'OCI', 'TT', 'SJKE', 'MFC_box', 'PRECIP_box'], # ['U200_box', 'Ro200_box', 'MFC_box'], # ['Ro200_30S-20S', 'Ro200_20S-10S'],