Notebook
fig, axs = plt.subplots(1, 2, figsize=(15, 10)) salt_bins = np.arange(20, 33, 0.5) month_bins = np.arange(0.5, 13, 1) cmap = cm.matter cmap.set_bad('white') c, xedge, yedge = np.histogram2d(np.concatenate((months, gmonths)), np.concatenate((sals, gsals)), weights=np.concatenate((transports, gtransports))/24/30.5/4./1000., bins=[month_bins, salt_bins]) axs[0].pcolormesh(xedge.T, yedge.T, c.T, vmin=0.2, vmax=18, cmap=cmap) print (c.max()) print ('min', c.min()) c1 = c.copy() c, xedge, yedge = np.histogram2d(np.concatenate((fmonths, gfmonths)), np.concatenate((fsals, gfsals)), weights=np.concatenate((ftransports, gftransports))/24/30.5/4./1000., bins=[month_bins, salt_bins]) axs[1].pcolormesh(xedge.T, yedge.T, c.T, vmin=0.2, vmax=18, cmap=cmap) for ax in axs: ax.invert_yaxis() ax.set_xlabel("Month"); ax.set_xticks(np.arange(1, 13)) ax.set_xticklabels(labels=['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], rotation=45) axs[0].set_ylabel('Salinity (g kg$^{-1}$)') axs[0].set_title('Flux into Strait of Georgia') axs[1].set_title('Flux out of Strait of Georgia'); fig.subplots_adjust(right=0.8) cbar_ax = fig.add_axes([0.85, 0.15, 0.05, 0.7]) cb1 = fig.colorbar(im, cax=cbar_ax) cb1.set_label('mSv', labelpad=2) fig.savefig('/home/sallen/MEOPAR/estuarine_flux_paper/fluxbysalt_masked.pdf') fig.savefig('/home/sallen/MEOPAR/estuarine_flux_paper/fluxbysalt_masked.png')