Skip to content
Snippets Groups Projects
Commit 9cd6a8ab authored by leufen1's avatar leufen1
Browse files

another adjustment

parent 70f79639
No related branches found
No related tags found
5 merge requests!319add all changes of dev into release v1.4.0 branch,!318Resolve "release v1.4.0",!299Draft: Merge default data handler and preprocessing support parameter use_multiprocessing....,!286Resolve "refac: limit axis in competing skill score plot",!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #65201 passed
...@@ -762,8 +762,7 @@ class PlotCompetitiveSkillScore(AbstractPlotClass): ...@@ -762,8 +762,7 @@ class PlotCompetitiveSkillScore(AbstractPlotClass):
showmeans=True, meanprops={"markersize": 3, "markeredgecolor": "k"}, flierprops={"marker": "."}, showmeans=True, meanprops={"markersize": 3, "markeredgecolor": "k"}, flierprops={"marker": "."},
order=order) order=order)
ax.axhline(y=0, color="grey", linewidth=.5) ax.axhline(y=0, color="grey", linewidth=.5)
ax.set(ylabel="skill score", xlabel="competing models", title="summary of all stations", ylim=self._lim(data))
ax.set(ylabel="skill score", xlabel="competing models", title="summary of all stations", ylim=self._lim())
handles, _ = ax.get_legend_handles_labels() handles, _ = ax.get_legend_handles_labels()
plt.xticks(rotation=90) plt.xticks(rotation=90)
ax.legend(handles, self._labels) ax.legend(handles, self._labels)
...@@ -777,9 +776,8 @@ class PlotCompetitiveSkillScore(AbstractPlotClass): ...@@ -777,9 +776,8 @@ class PlotCompetitiveSkillScore(AbstractPlotClass):
sns.boxplot(y="comparison", x="data", hue="ahead", data=data, whis=1., ax=ax, palette="Blues_d", sns.boxplot(y="comparison", x="data", hue="ahead", data=data, whis=1., ax=ax, palette="Blues_d",
showmeans=True, meanprops={"markersize": 3, "markeredgecolor": "k"}, flierprops={"marker": "."}, showmeans=True, meanprops={"markersize": 3, "markeredgecolor": "k"}, flierprops={"marker": "."},
order=order) order=order)
# ax.axhline(x=0, color="grey", linewidth=.5)
ax.axvline(x=0, color="grey", linewidth=.5) ax.axvline(x=0, color="grey", linewidth=.5)
ax.set(xlabel="skill score", ylabel="competing models", title="summary of all stations", xlim=self._lim()) ax.set(xlabel="skill score", ylabel="competing models", title="summary of all stations", xlim=self._lim(data))
handles, _ = ax.get_legend_handles_labels() handles, _ = ax.get_legend_handles_labels()
ax.legend(handles, self._labels) ax.legend(handles, self._labels)
plt.tight_layout() plt.tight_layout()
...@@ -795,7 +793,8 @@ class PlotCompetitiveSkillScore(AbstractPlotClass): ...@@ -795,7 +793,8 @@ class PlotCompetitiveSkillScore(AbstractPlotClass):
filtered_headers = list(filter(lambda x: "nn-" in x, data.comparison.unique())) filtered_headers = list(filter(lambda x: "nn-" in x, data.comparison.unique()))
return data[data.comparison.isin(filtered_headers)] return data[data.comparison.isin(filtered_headers)]
def _lim(self) -> Tuple[float, float]: @staticmethod
def _lim(data) -> Tuple[float, float]:
""" """
Calculate axis limits from data (Can be used to set axis extend). Calculate axis limits from data (Can be used to set axis extend).
...@@ -805,8 +804,8 @@ class PlotCompetitiveSkillScore(AbstractPlotClass): ...@@ -805,8 +804,8 @@ class PlotCompetitiveSkillScore(AbstractPlotClass):
:return: :return:
""" """
limit = 5 limit = 5
lower = np.max([-limit, np.min([0, helpers.float_round(self._data.min()[2], 2) - 0.1])]) lower = np.max([-limit, np.min([0, helpers.float_round(data.min()[2], 2) - 0.1])])
upper = np.min([limit, helpers.float_round(self._data.max()[2], 2) + 0.1]) upper = np.min([limit, helpers.float_round(data.max()[2], 2) + 0.1])
return lower, upper return lower, upper
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment