#!/usr/bin/env python # Wenchang Yang (wenchang@princeton.edu) # Fri Jun 20 04:30:55 PM EDT 2025 if __name__ == '__main__': import sys,os try: from misc.timer import Timer tt = Timer(f'[{os.getcwd()}] start ' + ' '.join(sys.argv)) except: pass import sys, os.path, os, glob, datetime import xarray as xr, numpy as np, pandas as pd, matplotlib.pyplot as plt #more imports wython = '/tigress/wenchang/wython' if wython not in sys.path: sys.path.append(wython); print('added to python path:', wython) #from misc import get_kws_from_argv from geoplots.cartopy.api import cartoproj from wyplot_map_qmin_diff_am2p5c360 import wyplot as plot_map_qmin_diff_am2p5c360 from wyplot_map_qmax_diff_am2p5c360 import wyplot as plot_map_qmax_diff_am2p5c360 from wyplot_map_precipmax_diff_am2p5c360 import wyplot as plot_map_precipmax_diff_am2p5c360 # if __name__ == '__main__': try: tt.check('end import') except: pass # #start from here if __name__ == '__main__': from wyconfig import * #my plot settings constrained_layout_off() proj = cartoproj('robin') fig = plt.figure(figsize=(12, 6), dpi=100) gs = fig.add_gridspec(nrows=5, ncols=8) axes = [] ax = fig.add_subplot(gs[0:2,0:4], projection=proj) im = plot_map_qmin_diff_am2p5c360(ax=ax, cbar_kwargs=dict(shrink=0.95))#, add_colorbar=False) axes.append(ax) ax = fig.add_subplot(gs[0:2,4:], projection=proj) im = plot_map_qmax_diff_am2p5c360(ax=ax, cbar_kwargs=dict(shrink=0.95))#, add_colorbar=False) axes.append(ax) ax = fig.add_subplot(gs[3:,2:6], projection=proj) im = plot_map_precipmax_diff_am2p5c360(ax=ax, cbar_kwargs=dict(shrink=0.95))#, add_colorbar=False) axes.append(ax) #fig.colorbar(im, ax=axes[-2:], label='$^\circ$C', extend='both') #savefig if 'savefig' in sys.argv or 's' in sys.argv: figname = __file__.replace('.py', f'.png') if 'overwritefig' in sys.argv or 'o' in sys.argv: wysavefig(figname, overwritefig=True) else: wysavefig(figname) constrained_layout_on() try: tt.check(f'**Done**') except: pass print() if 'notshowfig' in sys.argv or 'n' in sys.argv: pass else: if 'plt' in globals(): plt.show()