From 4ffd47833b5af1f5d89abddd370873ee026ec401 Mon Sep 17 00:00:00 2001
From: Colm Talbot <colm.talbot@ligo.org>
Date: Wed, 26 Sep 2018 10:01:04 +1000
Subject: [PATCH] make evidences work in labels without overwriting list make
 evidences work rather than bayes factors

---
 tupak/core/result.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tupak/core/result.py b/tupak/core/result.py
index 3b14ca1d..c845bbfd 100644
--- a/tupak/core/result.py
+++ b/tupak/core/result.py
@@ -665,11 +665,12 @@ def plot_multiple(results, filename=None, labels=None, colours=None,
 
     if evidences:
         if np.isnan(results[0].log_bayes_factor):
-            template = ' $\mathrm{{ln}}(Z)={:1.3g}$'
+            template = ' $\mathrm{{ln}}(Z)={lnz:1.3g}$'
         else:
-            template = ' $\mathrm{{ln}}(B)={:1.3g}$'
-        for i, label in enumerate(labels):
-            labels[i] = label + template.format(results[i].log_bayes_factor)
+            template = ' $\mathrm{{ln}}(B)={lnbf:1.3g}$'
+        labels = [template.format(lnz=result.log_evidence,
+                                  lnbf=result.log_bayes_factor)
+                  for ii, result in enumerate(results)]
 
     axes = fig.get_axes()
     ndim = int(np.sqrt(len(axes)))
-- 
GitLab