Skip to content
Snippets Groups Projects
Commit 22269e09 authored by Felix Kleinert's avatar Felix Kleinert
Browse files

update boot plot

parent 580c990c
Branches
Tags
1 merge request!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #65885 passed
...@@ -831,6 +831,7 @@ class PlotBootstrapSkillScore(AbstractPlotClass): ...@@ -831,6 +831,7 @@ class PlotBootstrapSkillScore(AbstractPlotClass):
self._labels = None self._labels = None
self._x_name = "boot_var" self._x_name = "boot_var"
self._data = self._prepare_data(data) self._data = self._prepare_data(data)
self._individual_vars = set(self._data[self._x_name].values)
self._plot() self._plot()
self._save() self._save()
self.plot_name += '_separated' self.plot_name += '_separated'
...@@ -900,6 +901,7 @@ class PlotBootstrapSkillScore(AbstractPlotClass): ...@@ -900,6 +901,7 @@ class PlotBootstrapSkillScore(AbstractPlotClass):
data_second = self._select_data(df=data, variables=remaining_vars, column_name='boot_var') data_second = self._select_data(df=data, variables=remaining_vars, column_name='boot_var')
fig, ax = plt.subplots(nrows=1, ncols=2, fig, ax = plt.subplots(nrows=1, ncols=2,
figsize=(len(self._individual_vars) / 2, 10),
gridspec_kw={'width_ratios': [len(separate_vars), gridspec_kw={'width_ratios': [len(separate_vars),
len(remaining_vars) len(remaining_vars)
] ]
...@@ -981,11 +983,11 @@ class PlotBootstrapSkillScore(AbstractPlotClass): ...@@ -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", 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": "."}) showmeans=True, meanprops={"markersize": 1, "markeredgecolor": "k"}, flierprops={"marker": "."})
ax.axhline(y=0, color="grey", linewidth=.5) 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") ax.set(ylabel=f"skill score", xlabel="", title="summary of all stations")
handles, _ = ax.get_legend_handles_labels() handles, _ = ax.get_legend_handles_labels()
ax.legend(handles, self._labels) ax.legend(handles, self._labels)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment