#!/usr/bin/env python # Wenchang Yang (wenchang@princeton.edu) # Thu Jun 4 11:50:59 EDT 2020 if __name__ == '__main__': from misc.timer import Timer tt = Timer(f'start {__file__}') import sys, os.path, os, glob import xarray as xr, numpy as np, pandas as pd import matplotlib.pyplot as plt #more imports import xaddon from ERA5.fig_scatter_ntc_vs_all import get_scatter_data, scatterplot from IBTrACS.data_ntc_cycle import get_cycle as cycle_ntc # if __name__ == '__main__': tt.check('end import') # #start from here basin = 'NA' years = slice('1980', '2018') ds = get_scatter_data(basin=basin, years=years) ds['ntc_ib'] = cycle_ntc(basin=basin, years=years)['mclim'] if __name__ == '__main__': from wyconfig import * #my plot settings fig, axes = plt.subplots(1, 3, sharey=True, figsize=(8,3)) suptitle = 'Obs. (IBTrACS TC)' #figname = __file__.replace('.py', f'_{tt.today()}.png') ax = axes[0] scatterplot(ax=ax, xlabel='p($\Lambda$)', ylabel='N_TC', x='p', y='ntc_ib', data=ds) ax = axes[1] scatterplot(ax=ax, xlabel='N_SEED', x='nseed', y='ntc_ib', data=ds) ax = axes[2] scatterplot(ax=ax, xlabel='N_SEED$\\times$p($\Lambda$)', x='nseedxp', y='ntc_ib', data=ds) fig.suptitle(suptitle) if len(sys.argv)>1 and sys.argv[1]=='savefig': figname = __file__.replace('.py', '.png') wysavefig(figname) tt.check(f'**Done**') plt.show()