From 23fef174f2382db5e2bdc7823f4bd832920e8726 Mon Sep 17 00:00:00 2001 From: tforest Date: Wed, 29 Nov 2023 15:29:12 +0100 Subject: [PATCH] Ok likelihood swp2 --- swp2.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/swp2.py b/swp2.py index c321d00..346362f 100644 --- a/swp2.py +++ b/swp2.py @@ -288,7 +288,6 @@ def plot_all_epochs_thetafolder(folder_path, mu, tgen, title = "Title", theta_sc plt.title(title) plt.savefig(title+'_b'+str(breaks)+'.pdf') # plot likelihood against nb of breakpoints - # best possible likelihood from SFS # Segregating sites S = sum(SFS_stored) @@ -390,20 +389,19 @@ def plot_test_theta(folder_path, mu, tgen, title = "Title", theta_scale = True, for i in range(0, len(x)): T += y[i] / (x[i]*(x[i]-1)) x_2.append(T) - # Plotting (fig 2) - plt.plot(x_2, y, 'o', linestyle="dotted", alpha=0.75, lw=2, label = str(epoch)+' brks') - plt.xlabel("# breaks") - plt.ylabel("theta") - plt.legend(loc='upper right') - plt.savefig(title+'_test'+str(k)+'.pdf') - - # Plotting (fig 3) which is the same but log scale for x - plt.plot(x_2, y, 'o', linestyle="dotted", alpha=0.75, lw=2, label = str(epoch)+' brks') - plt.xscale('log') - plt.xlabel("# breaks") - plt.ylabel("theta") - plt.legend(loc='upper right') - plt.savefig(title+'_test'+str(k)+'_log.pdf') + # Plotting (fig 2) + plt.plot(x_2, y, 'o', linestyle="dotted", alpha=0.75, lw=2, label = str(epoch)+' brks') + plt.xlabel("# breaks") + plt.ylabel("theta") + plt.legend(loc='upper right') + plt.savefig(title+'_test'+str(k)+'.pdf') + # Plotting (fig 3) which is the same but log scale for x + plt.plot(x_2, y, 'o', linestyle="dotted", alpha=0.75, lw=2, label = str(epoch)+' brks') + plt.xscale('log') + plt.xlabel("# breaks") + plt.ylabel("theta") + plt.legend(loc='upper right') + plt.savefig(title+'_test'+str(k)+'_log.pdf') def save_multi_image(filename): pp = PdfPages(filename)