From 03a411ab52bb4e4e474252763faca4650d648aa8 Mon Sep 17 00:00:00 2001
From: Tamas Gal <tgal@km3net.de>
Date: Thu, 3 Oct 2019 00:50:38 +0200
Subject: [PATCH] Another attempt to fix right label issue

---
 scripts/trigger_rates.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/scripts/trigger_rates.py b/scripts/trigger_rates.py
index 0de1d3f..492a9b8 100755
--- a/scripts/trigger_rates.py
+++ b/scripts/trigger_rates.py
@@ -246,6 +246,10 @@ class TriggerRate(kp.Module):
         ax.set_ylabel("trigger rate [Hz]")
         ax.xaxis.set_major_formatter(self.styles["xfmt"])
         ax.grid(True, which='minor')
+        try:
+            ax.set_yscale('log')
+        except ValueError:
+            pass
         ax.tick_params(labelright=True)
         if self.with_minor_ticks:
             ax.minorticks_on()
@@ -253,18 +257,15 @@ class TriggerRate(kp.Module):
 
         # fig.tight_layout()
 
-        filename = join(self.plots_path, self.filename + '_lin.png')
-        filename_tmp = join(self.plots_path, self.filename + '_lin_tmp.png')
+        filename = join(self.plots_path, self.filename + '.png')
+        filename_tmp = join(self.plots_path, self.filename + '_tmp.png')
         fig.savefig(filename_tmp, dpi=120, bbox_inches="tight")
         shutil.move(filename_tmp, filename)
 
-        try:
-            ax.set_yscale('log')
-        except ValueError:
-            pass
+        ax.set_yscale("linear")
 
-        filename = join(self.plots_path, self.filename + '.png')
-        filename_tmp = join(self.plots_path, self.filename + '_tmp.png')
+        filename = join(self.plots_path, self.filename + '_lin.png')
+        filename_tmp = join(self.plots_path, self.filename + '_lin_tmp.png')
         fig.savefig(filename_tmp, dpi=120, bbox_inches="tight")
         shutil.move(filename_tmp, filename)
 
-- 
GitLab