def plot_label(x, y, cent_xy, cent_label, title, show=None, pic_path=None): ncent = cent_label.shape[0] img = Image_Plot() img.subplots(1, 1) for i in range(ncent): img.axs[0][0].scatter(cent_xy[0][i], cent_xy[1][i], color="C%d" % i, marker="*", s=80) idx = cent_label[i] == 1 img.axs[0][0].scatter(x[idx], y[idx], edgecolors="C%d" % i, color="none", label="%d, %d" % (i, idx.sum()), s=5) img.axs[0][0].set_title(title) img.axs[0][0].legend() if pic_path: img.save_img(pic_path) if show: img.show_img() img.close_img()
marker="o", fillstyle="none", c="C1", label="$m_1$, weight=$\\tilde{\\nu}_F^{-2}$") img.axs[0][0].errorbar(x_coord, 100 * mc2_mpk_pk_fit[0], 100 * mc2_mpk_pk_fit[1], linewidth=img.plt_line_width - 0.5, capsize=img.cap_size, marker="o", fillstyle="none", ls="--", c="C1", label="$m_2$, weight=$\\tilde{\\nu}_F^{-2}$") # img.axs[0][0].errorbar(x_coord, 100 * mc1_mpk_tmag[0], 100 * mc1_mpk_tmag[1], linewidth=img.plt_line_width, # capsize=img.cap_size, marker="s", fillstyle="none") xs = img.axs[0][0].set_xlim() ys = img.axs[0][0].set_ylim(-1.02, 1.02) img.axs[0][0].plot([xs[0], 100], [0, 0], linewidth=img.plt_line_width - 0.5, c="grey", alpha=0.7, linestyle="--") img.axs[0][0].xaxis.set_major_formatter(xticks) img.axs[0][0].set_xlabel("Cutoff percentage", fontsize=img.xy_lb_size) img.axs[0][0].set_ylabel("$m_{1/2}\\times 10^2$", fontsize=img.xy_lb_size) img.axs[0][0].set_xticks(x_tick) img.axs[0][0].legend(ncol=2, fontsize=img.legend_size, frameon=False) img.save_img("E:/weight_compare.pdf") img.show_img()