From 22269e09991d92fffbe0bc81ca9f3a7f504cffdc Mon Sep 17 00:00:00 2001 From: Felix Kleinert <f.kleinert@fz-juelich.de> Date: Tue, 20 Apr 2021 07:46:55 +0200 Subject: [PATCH] update boot 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 b7ebad81..ce53f4c5 100644 --- a/mlair/plotting/postprocessing_plotting.py +++ b/mlair/plotting/postprocessing_plotting.py @@ -831,6 +831,7 @@ class PlotBootstrapSkillScore(AbstractPlotClass): self._labels = None self._x_name = "boot_var" self._data = self._prepare_data(data) + self._individual_vars = set(self._data[self._x_name].values) self._plot() self._save() self.plot_name += '_separated' @@ -900,6 +901,7 @@ class PlotBootstrapSkillScore(AbstractPlotClass): data_second = self._select_data(df=data, variables=remaining_vars, column_name='boot_var') fig, ax = plt.subplots(nrows=1, ncols=2, + figsize=(len(self._individual_vars) / 2, 10), gridspec_kw={'width_ratios': [len(separate_vars), len(remaining_vars) ] @@ -981,11 +983,11 @@ class PlotBootstrapSkillScore(AbstractPlotClass): """ """ - fig, ax = plt.subplots() + fig, ax = plt.subplots(figsize=(len(self._individual_vars)/2, 10)) sns.boxplot(x=self._x_name, y="data", hue="ahead", data=self._data, ax=ax, whis=1., palette="Blues_d", showmeans=True, meanprops={"markersize": 1, "markeredgecolor": "k"}, flierprops={"marker": "."}) ax.axhline(y=0, color="grey", linewidth=.5) - plt.xticks(rotation=45) + plt.xticks(rotation=45, horizontalalignment="right") ax.set(ylabel=f"skill score", xlabel="", title="summary of all stations") handles, _ = ax.get_legend_handles_labels() ax.legend(handles, self._labels) -- GitLab