xs = img.axs[2 * i + 1][0].set_xlim() img.axs[2 * i + 1][0].plot([xs[0], xs[1]], [1, 1], ls="--", alpha=0.4, c="k") img.axs[2 * i + 1][0].plot([xs[0], xs[1]], [0, 0], ls="--", alpha=0.4, c="k") img.axs[2 * i + 1][0].plot([xs[0], xs[1]], [-1, -1], ls="--", alpha=0.4, c="k") labels = [ "noise_free\n$10^2m_{1/2}$", "noise_free\n$10^4c_{1/2}$", "noisy\n$10^2m_{1/2}$", "noisy\n$10^4c_{1/2}$" ] for i in range(4): img.set_label(i, 0, 0, labels[i], fontsize=img.xy_lb_size - 2) psf_scale = [ "$r_d=1.6$", "$r_d=2$", "$r_d=2.5$", "$r_d=3$", "$r_d=4$", "$r_d=6$", "$r_d=7$" ] # img.axs[3][0].set_xticks(x_tick_pos) # img.axs[3][0].set_xticklabels(psf_scale) img.set_ticklabel_str(3, 0, 1, x_tick_pos, psf_scale) img.save_img(parent_path + "/result.png")
marker="s") img.axs[1][i].errorbar(x + 0.15, pdf_mcs[2] * c_scale, pdf_mcs[3] * c_scale, label="PDF $10^4c1$", capsize=img.cap_size, marker="o", ls="--") img.axs[1][i].errorbar(x + 0.15, pdf_mcs[6] * c_scale, pdf_mcs[7] * c_scale, label="PDF $10^4c2$", capsize=img.cap_size, marker="o", ls="--") img.axs[0][i].legend(ncol=2, fontsize=img.legend_size - 8, loc="upper left") img.axs[1][i].legend(ncol=2, fontsize=img.legend_size - 8, loc="upper left") img.set_ticklabel_str(0, i, 1, x, xlabels) img.set_ticklabel_str(1, i, 1, x, xlabels) img.axs_text(0, i, 0.1, 0.1, weight[i], text_color="k") img.axs_text(1, i, 0.1, 0.1, weight[i], text_color="k") img.axs[0][i].set_ylim(-1.5, 1.5) img.axs[1][i].set_ylim(-0.5, 0.5) img.save_img(pic_nm) # img.show_img() img.close_img()
scale = [24.2423, 23.4742] line_labels = ["$30%$ cutoff", "$60%$ cutoff"] img = Image_Plot(legend_size=14, fig_x=6, fig_y=4, plt_line_width=2, axis_linewidth=2, xpad=0.2) img.subplots(1, 1) # img.set_style() img.axis_type(0, "major", tick_len=6, tick_width=1.2) img.axis_type(1, "major", tick_len=6, tick_width=1.2) bins = img.axs[0][0].hist(-mag_true, 50, ec="gray", label="Entire sample")[1] img.axs[0][0].hist(-mag_true[idx], bins, ec="gray", label="Detected sample") ys = img.axs[0][0].set_ylim() for i, s in enumerate(scale): img.axs[0][0].plot([s, s], [ys[0], ys[1]], lw=img.plt_line_width, ls="--", label=line_labels[i]) img.axs[0][0].legend(fontsize=img.legend_size, frameon=False) img.set_ticklabel_str(0, 0, 0, [2 * i * 100000 for i in range(1, 7)], ["%d" % (2 * i) for i in range(1, 7)]) img.set_label(0, 0, 0, "$10^{-5}N$") img.set_label(0, 0, 1, "Magnitude") # img.axs[0][0].set_xlim(22, 25) img.save_img("E:/cutoff_line.pdf") img.show_img()
ls=ls[0], c=ls[1]) ys = img.axs[0][0].set_ylim() img.axs[0][0].plot([chi_guess[i], chi_guess[i]], [ys[0], ys[1]], c=ls[1]) img.axs[0][0].legend(ncol=2, fontsize=12, loc="lower center") ys = img.axs[0][0].set_ylim() img.axs[0][0].set_xscale("symlog") img.axs[0][0].set_ylim(1, 170) # img.axs[0][0].set_xlim(-4*10**(-6),8*10**(-6)) img.axs[0][0].set_yscale("log") img.axs[0][0].set_title(titles[j]) img.set_label(0, 0, 0, "$\\chi^2$") img.set_label(0, 0, 1, "$\\xi_1$ guess") img.set_ticklabel_str(0, 0, 1, [1.e-7, 1.e-6, 1.e-5], ["$10^{-%d}$" % i for i in range(7, 4, -1)]) img.save_img(data_path + "/chisq_%s.png" % data_type[j]) # img.show_img() img.close_img() numpy.savez(data_path + "/xi_cache_%s.npz" % data_type[0], chi_measures[0]) numpy.savez(data_path + "/xi_cache_%s.npz" % data_type[1], chi_measures[1]) cs = ["C2", "C1"] img = Image_Plot(fig_x=5, fig_y=5, xpad=0.15, ypad=0.15) img.subplots(1, 1) for i in range(1, -1, -1): img.axs[0][0].errorbar(chi_guess, chi_measures[i][0], chi_measures[i][1], marker="s",