with plt.style.context(pubStyle): fig, ax = plt.subplots(1,1,figsize=(10,7)) filters = ("F275W", "F814W", "F814W") bestFitResultsA = optimizationResults['bf']['A'][0] bestFitResultsB = optimizationResults['bf']['E'][0] bestFitOptimizationResultA = optimizationResults['r']['A'][bestFitResultsA[3]][bestFitResultsA[4]] bestFitOptimizationResultB = optimizationResults['r']['E'][bestFitResultsB[3]][bestFitResultsB[4]] bestFitPhotF1 = optimizationResults['phot'][filters[0]] bestFitPhotF2 = optimizationResults['phot'][filters[1]] bestFitPhotF3 = optimizationResults['phot'][filters[2]] bestFitPhotColor = bestFitPhotF1-bestFitPhotF2 bestFitPhotMag = bestFitPhotF3 bestFitAgeA = bestFitOptimizationResultA['opt']['x'][0] bestFitDistanceA = bestFitOptimizationResultA['opt']['x'][1] bestFitExtinctionA = bestFitOptimizationResultA['opt']['x'][2] bestFitAgeB = bestFitOptimizationResultB['opt']['x'][0] bestFitDistanceB = bestFitOptimizationResultB['opt']['x'][1] bestFitExtinctionB = bestFitOptimizationResultB['opt']['x'][2] c = 0 bestFitIsoAptMagA, bestFitIsoAptColorA = iso_at_params(bestFitOptimizationResultA['iso'], bestFitAgeA, bestFitDistanceA-c, bestFitExtinctionA, *filters) bestFitIsoAptMagB, bestFitIsoAptColorB = iso_at_params(bestFitOptimizationResultB['iso'], bestFitAgeB, bestFitDistanceB, bestFitExtinctionB, *filters) # ax.scatter(bestFitPhotColor, bestFitPhotMag, s=1, alpha=0.01, color='yellow') ax.plot(bestFitOptimizationResultA['fiducial'][:, 0], bestFitOptimizationResultA['fiducial'][:, 1], color='black', marker='o', linestyle='', markersize=2) ax.plot(bestFitOptimizationResultB['fiducial'][:, 0], bestFitOptimizationResultB['fiducial'][:, 1], color='orange', marker='o', linestyle='', markersize=2) ax.plot(bestFitIsoAptColorA, bestFitIsoAptMagA, color='blue', alpha=0.5, label='Population A') ax.plot(bestFitIsoAptColorB, bestFitIsoAptMagB, color='red', alpha=0.5, label='Population E') ax.set_xlabel(f"{filters[0]} - {filters[1]}", fontsize=27) ax.set_ylabel(f"{filters[2]}", fontsize=27) ax.invert_yaxis() ax.annotate(fr"$\mu_{{A}} = {5*np.log10(bestFitDistanceA-c)-5:0.2f}$", (7, 14), fontsize=10) ax.annotate(fr"Age$_{{A}} = {bestFitAgeA:0.2f}$ Gyr", (7, 14.5), fontsize=10) ax.annotate(fr"$E(B-V)_{{A}} = {bestFitExtinctionA:0.2f}$", (7, 15), fontsize=10) ax.annotate(fr"Y$_{{A}} = {bestFitResultsA[3]}$", (7, 15.5), fontsize=10) ax.annotate(fr"$\alpha_{{ML,A}} = {bestFitResultsA[4]}$", (7, 16), fontsize=10) ax.annotate(fr"$\chi^{{2}}_{{\nu,A}} = {bestFitOptimizationResultA['opt']['fun']:0.4f}$",(7,16.5),fontsize=10) ax.annotate(fr"$\mu_{{E}} = {5*np.log10(bestFitDistanceB)-5:0.2f}$", (7, 18), fontsize=10) ax.annotate(fr"Age$_{{E}} = {bestFitAgeB:0.2f}$ Gyr", (7, 18.5), fontsize=10) ax.annotate(fr"$E(B-V)_{{E}} = {bestFitExtinctionB:0.2f}$", (7, 19), fontsize=10) ax.annotate(fr"Y$_{{E}} = {bestFitResultsB[3]}$", (7, 19.5), fontsize=10) ax.annotate(fr"$\alpha_{{ML,E}} = {bestFitResultsB[4]}$", (7, 20), fontsize=10) ax.annotate(fr"$\chi^{{2}}_{{\nu,E}} = {bestFitOptimizationResultB['opt']['fun']:0.4f}$",(7,20.5),fontsize=10) ax.legend(frameon=False) plt.savefig("Figures/DualPopFit.pdf")