pprob.append(prob) plist.append(cmean) shearlist.append(((shearbins[id + 1]) - c) / 2) xtick = shearbins[0:-1] xtickwidth = (shearbins[1::] - shearbins[0:-1]) fig = plt.figure(figsize=(25, 45), dpi=70) ax1 = fig.add_subplot(331) xy = np.vstack([sh, pp]) z = gaussian_kde(xy)(xy) test = z / (z.max() - z.min()) r = u_stat.pcor(sh, pp, qq) mappable = ax1.scatter(sh, pp, c=test, edgecolor='', cmap='viridis_r', s=20) # viridis_r ax1.set_ylabel('Max. rainfall (mm h$^{-1}$)') ax1.set_xlabel('u925hPa') ax1.set_title('P-corr. u925hPa/rain | q removed: ' + str(np.round(r[0], decimals=2)), fontsize=cc) ax1.tick_params(direction='in') cbar = fig.colorbar(mappable) cbar.set_label('Density') print('Partial correlation umin_mid:', u_stat.pcor(umin, pp, qq)) #################################################################################### ax2 = fig.add_subplot(332)
pprob.append(prob) plist.append(cmean) shearlist.append(((shearbins[id + 1]) - c) / 2) xtick = shearbins[0:-1] xtickwidth = (shearbins[1::] - shearbins[0:-1]) fig = plt.figure(figsize=(10, 6), dpi=200) ax1 = fig.add_subplot(221) xy = np.vstack([sh, tt]) z = gaussian_kde(xy)(xy) test = z / (z.max() - z.min()) r = u_stat.pcor(sh, tt, qq) mappable = ax1.scatter(sh, tt, c=test, edgecolor='', cmap='viridis_r', s=20) # viridis_r ax1.set_ylabel('Min. T ($^{\circ}$C)') ax1.set_xlabel('Max. zonal wind shear (m s$^{-1}$)') ax1.set_title('P-corr. shear/T | q removed: ' + str(np.round(r[0], decimals=2)), fontsize=cc) ax1.tick_params(direction='in') cbar = fig.colorbar(mappable) cbar.set_label('Density') #################################################################################### ax2 = fig.add_subplot(222)
pprob.append(prob) plist.append(cmean) shearlist.append(((shearbins[id + 1]) - c) / 2) xtick = shearbins[0:-1] xtickwidth = (shearbins[1::] - shearbins[0:-1]) fig = plt.figure(figsize=(25, 45), dpi=70) ax1 = fig.add_subplot(221) xy = np.vstack([sh, pp]) z = gaussian_kde(xy)(xy) test = z / (z.max() - z.min()) r = u_stat.pcor(sh, pp, qq) mappable = ax1.scatter(sh, pp, c=test, edgecolor='', cmap='viridis_r', s=20) # viridis_r ax1.set_ylabel('Max. rainfall (mm h$^{-1}$)') ax1.set_xlabel('u925hPa') ax1.set_title('P-corr. u925hPa/rain | q removed: ' + str(np.round(r[0], decimals=2)), fontsize=cc) ax1.tick_params(direction='in') cbar = fig.colorbar(mappable) cbar.set_label('Density') print('Partial correlation umin_mid:', u_stat.pcor(umin, pp, qq)) #################################################################################### ax2 = fig.add_subplot(222)
plist.append(cmean) shearlist.append(((shearbins[id+1])-c)/2) xtick = shearbins[0:-1] xtickwidth= (shearbins[1::]-shearbins[0:-1]) fig = plt.figure(figsize=(25, 45), dpi=70) ax1 = fig.add_subplot(221) xy = np.vstack([sh, pp]) z = gaussian_kde(xy)(xy) test = z / (z.max() - z.min()) r = u_stat.pcor(sh,pp, qq) r=stats.pearsonr(sh,pp) mappable = ax1.scatter(sh, pp, c=test, edgecolor='', cmap='viridis_r', s=20) # viridis_r ax1.set_ylabel('Max. rainfall (mm h$^{-1}$)') ax1.set_xlabel('u925hPa') ax1.set_title('P-corr. u925hPa/rain | q removed: '+str(np.round(r[0], decimals=2)), fontsize=cc) ax1.tick_params(direction='in') cbar = fig.colorbar(mappable) cbar.set_label('Density') print('Partial correlation umin_mid:', u_stat.pcor(umin,pp, qq) ) #################################################################################### ax2 = fig.add_subplot(222) xy = np.vstack([pp,qq])
plist.append(cmean) shearlist.append(((shearbins[id+1])-c)/2) xtick = shearbins[0:-1] xtickwidth= (shearbins[1::]-shearbins[0:-1]) fig = plt.figure(figsize=(10, 6), dpi=200) ax1 = fig.add_subplot(221) xy = np.vstack([sh, tt]) z = gaussian_kde(xy)(xy) test = z / (z.max() - z.min()) r = u_stat.pcor(sh,tt, qq) mappable = ax1.scatter(sh, tt, c=test, edgecolor='', cmap='viridis_r', s=20) # viridis_r ax1.set_ylabel('Min. T ($^{\circ}$C)') ax1.set_xlabel('Max. zonal wind shear (m s$^{-1}$)') ax1.set_title('P-corr. shear/T | q removed: '+str(np.round(r[0], decimals=2)), fontsize=cc) ax1.tick_params(direction='in') cbar = fig.colorbar(mappable) cbar.set_label('Density') #################################################################################### ax2 = fig.add_subplot(222) xy = np.vstack([qq,tt]) z = gaussian_kde(xy)(xy) test = z / (z.max() - z.min())