import xarray as xr from geoplots import mapplot fig, axes = plt.subplots(1, 3, figsize=(8, 2.5), sharey=True) levels = np.arange(-0.9, 0.91, 0.2) cmap = 'BrBG' xlim = (360-150, 360-40) ylim = (10, 70) scale = 24*3600 ax = axes[0] plt.sca(ax) ifile = 'precip_anom.dust_bowl.nc' da = xr.open_dataarray(ifile) im = da.pipe(lambda x: x*scale).plot.contourf(levels=levels, cmap=cmap, ax=ax, add_colorbar=False) mapplot() ax.set_xlim(xlim); ax.set_ylim(ylim) plt.xlabel(''); plt.ylabel('') ax.set_title('Dust Bowl Pr_a CTL') ax = axes[1] plt.sca(ax) da_chan = xr.open_dataarray('precip_anom.dust_bowl.chan.nc') im = da_chan.pipe(lambda x: x*scale).plot.contourf(levels=levels, cmap=cmap, ax=ax, add_colorbar=False) mapplot() ax.set_xlim(xlim); ax.set_ylim(ylim) plt.xlabel(''); plt.ylabel('') ax.set_title('Chan') ax = axes[2] plt.sca(ax) daa = da_chan - da im = daa.pipe(lambda x: x*scale).plot.contourf(levels=levels, cmap=cmap, ax=ax, add_colorbar=False) mapplot() ax.set_xlim(xlim); ax.set_ylim(ylim) plt.xlabel(''); plt.ylabel('') ax.set_title('Chan - CTL') plt.tight_layout() cbar = plt.colorbar(im, ax=axes, pad=0.01) cbar.set_label('mm/day') figname = 'fig.dust_bowl.chancorr.png' plt.savefig(figname, dpi=150)