From a6ef3dfbaf01ae50bdb53693a9fe72a646569343 Mon Sep 17 00:00:00 2001
From: Guenter Quast <guenter.quast@kit.edu>
Date: Wed, 17 Apr 2024 23:06:02 +0200
Subject: [PATCH] nicer kafe2 graphics

---
 examples/peakFitter.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/examples/peakFitter.py b/examples/peakFitter.py
index 6bd69d8..b33343b 100755
--- a/examples/peakFitter.py
+++ b/examples/peakFitter.py
@@ -131,7 +131,7 @@ for i, p in enumerate(peaks):
     bins = range(mn, mx+1)
     counts = hst[mn : mx]
     hfit_data = HistContainer(bin_edges = bins)
-    hfit_data.label="peak " + str(i)
+    hfit_data.label="peak " + str(i+1)
     hfit_data.set_bins(counts)
     #Fit
     fit = HistFit(data = hfit_data, model_function = gauss_plus_bkg, density=False)
@@ -220,12 +220,15 @@ if plot:
                linewidth=1, linestyle='dashed', color='goldenrod')
         ax1.hlines(mx-h/2, mu-fwhm/2, mu+fwhm/2,
                linewidth=2, color='goldenrod')
+        ax1.hlines(mx-h, mu-fwhm/4, mu+fwhm/4,
+               linewidth=3, color='goldenrod')
         ax1.legend(loc = 'best')
 
     if kafe2_plots:
     # kafe2 plots
         fit_results = np.append(fit_results, hdata)
         p = Plot(fit_results)
+        p.customize('data', 'alpha', [(i, 0.25) for i in range(len(peaks))]+[(len(peaks), 0.05)])
         p.plot()
     plt.show()
        
-- 
GitLab