From 46e15cd7a9b74ec716ea19a82acb8c79b403f75b Mon Sep 17 00:00:00 2001
From: "gregory.ashton" <gregory.ashton@ligo.org>
Date: Tue, 11 Apr 2017 11:02:50 +0200
Subject: [PATCH] Fixes corner_plot prior for rescaled params

---
 pyfstat/mcmc_based_searches.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pyfstat/mcmc_based_searches.py b/pyfstat/mcmc_based_searches.py
index d5c9bc7..263422d 100644
--- a/pyfstat/mcmc_based_searches.py
+++ b/pyfstat/mcmc_based_searches.py
@@ -571,7 +571,7 @@ class MCMCSearch(core.BaseSearchClass):
             fig.subplots_adjust(hspace=0.05, wspace=0.05)
 
             if add_prior:
-                self.add_prior_to_corner(axes, samples_plt)
+                self.add_prior_to_corner(axes, self.samples)
 
             fig_triangle.savefig('{}/{}_corner.png'.format(
                 self.outdir, self.label), dpi=dpi)
@@ -587,8 +587,8 @@ class MCMCSearch(core.BaseSearchClass):
             subtractor = self.get_rescale_subtractor_for_key(key)
             ax2 = ax.twinx()
             ax2.get_yaxis().set_visible(False)
-            ax2.plot(x, [(prior(xi)-subtractor)*multiplier for xi in x], '-r')
-            ax.set_xlim(xlim)
+            ax2.plot((x-subtractor)*multiplier, [prior(xi) for xi in x], '-r')
+            ax2.set_xlim(xlim)
 
     def plot_prior_posterior(self, normal_stds=2):
         """ Plot the posterior in the context of the prior """
-- 
GitLab