"""talk_7 for a round 5 ensemble (round4/ensemble/plot_talk.py): the NAT ensemble with the 5 HIST quantile members on top, volume, from 1300. python plot_talk.py (NAME / GDIR_EXP env vars, see talk_common.py) -> talk/talk_7_.png """ import matplotlib.pyplot as plt import seaborn as sns from talk_common import (NAME, TALK, ids, load, order, colors, label, VOLUME_REFS, ref_lia_vol) nat, hist = load('volume') with sns.axes_style('whitegrid'): fig, ax = plt.subplots(figsize=(10, 5.5)) for i, c in enumerate(nat.columns): ax.plot(nat.index, nat[c].values, color='C0', alpha=0.15, linewidth=0.8, label='NAT ensemble' if i == 0 else '_nolegend_') ax.plot(nat.index, nat.mean(axis=1), label='NAT ensemble mean', color='navy', linewidth=2) for m in order: ax.plot(hist.index, hist[m].values, label=label(m), color=colors[m], linewidth=2) for r in [ref_lia_vol] + VOLUME_REFS: r(ax, hist[order]) ax.set_xlabel('Year') ax.set_ylabel('Total volume (km$^3$)') ax.set_xlim([1300, nat.index.max()]) ax.set_title(f'{NAME}: {len(ids)} glaciers, {nat.shape[1]} NAT members') ax.legend(loc='lower left', fontsize=9) fig.savefig(f'{TALK}/talk_7_{NAME}.png', bbox_inches='tight', dpi=150) print(f'Written: {TALK}/talk_7_{NAME}.png')