From f77048a52b66e77ff7c7879d5346a14c02feb231 Mon Sep 17 00:00:00 2001
From: Felix Kleinert <f.kleinert@fz-juelich.de>
Date: Thu, 6 Jan 2022 12:14:01 +0100
Subject: [PATCH] use lim on upstream plot

---
 mlair/plotting/postprocessing_plotting.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mlair/plotting/postprocessing_plotting.py b/mlair/plotting/postprocessing_plotting.py
index a0c701ac..8ef634ef 100644
--- a/mlair/plotting/postprocessing_plotting.py
+++ b/mlair/plotting/postprocessing_plotting.py
@@ -639,6 +639,7 @@ class PlotSectorialSkillScore(AbstractPlotClass):  # pragma: no cover
         data = self._data
         sns.boxplot(x="sector", y="data", hue="ahead", data=data, whis=1, ax=ax, palette="Blues_d",
                     showmeans=True, meanprops={"markersize": 3, "markeredgecolor": "k"}, flierprops={"marker": "."},
+                    ylim=self._lim(data)
                     )
         ax.axhline(y=0, color="grey", linewidth=.5)
         ax.set(ylabel=f"skill score ({self._model_setup} vs. {self._reference_model})", xlabel="sector",
@@ -654,7 +655,8 @@ class PlotSectorialSkillScore(AbstractPlotClass):  # pragma: no cover
         data = self._data
         sns.boxplot(y="sector", x="data", hue="ahead", data=data, whis=1.5, ax=ax, palette="Blues_d",
                     showmeans=True, meanprops={"markersize": 3, "markeredgecolor": "k"}, flierprops={"marker": "."},
-                    )
+                    xlim=self._lim(data)
+                        )
         ax.axvline(x=0, color="grey", linewidth=.5)
         ax.set(xlabel=f"skill score ({self._model_setup} vs. {self._reference_model})", ylabel="sector",
                title="summary of all stations")
@@ -674,7 +676,7 @@ class PlotSectorialSkillScore(AbstractPlotClass):  # pragma: no cover
         """
         limit = 5
         lower = np.max([-limit, np.min([0, helpers.float_round(data["data"].min(), 2) - 0.1])])
-        upper = np.min([limit, helpers.float_round(data.max()[2], 2) + 0.1])
+        upper = np.min([limit, helpers.float_round(data["data"].max(), 2) + 0.1])
         return lower, upper
 
 
-- 
GitLab