#!/usr/bin/env python # Wenchang Yang (wenchang@princeton.edu) # Mon Jul 3 12:29:16 EDT 2023 if __name__ == '__main__': import sys,os from misc.timer import Timer tt = Timer(f'[{os.getcwd()}] start ' + ' '.join(sys.argv)) 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 fig_lines_lat import wyplot as plot_lines_lat from fig_bars_dprecip_dTs import wyplot as plot_bars_dprecip_dTs # if __name__ == '__main__': tt.check('end import') # #start from here if __name__ == '__main__': from wyconfig import * #my plot settings figsize = 6, 6 fig, axes = plt.subplots(2, 1, figsize=figsize) ax = axes[0] plot_lines_lat(ax=ax) ax.set_title('(a)') ax = axes[1] plot_bars_dprecip_dTs(ax=ax) ax.set_title('(b)') #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) tt.check(f'**Done**') print() if 'notshowfig' in sys.argv or 'n' in sys.argv: pass else: if 'plt' in globals(): plt.show()