Skip to content
Snippets Groups Projects
Commit 6c5da825 authored by leufen1's avatar leufen1
Browse files

plot looks nice for now, /close #381

parent 52dee82f
No related branches found
No related tags found
4 merge requests!432IOA works now also with xarray and on identical data, IOA is included in...,!431Resolve "release v2.1.0",!430update recent developments,!422Resolve "time evolution of metrics"
...@@ -1302,17 +1302,13 @@ class PlotTimeEvolutionMetric(AbstractPlotClass): ...@@ -1302,17 +1302,13 @@ class PlotTimeEvolutionMetric(AbstractPlotClass):
return min(max(1.25 * val + 7.5, 10), 30) return min(max(1.25 * val + 7.5, 10), 30)
def _plot(self, data, years, months, vmin=None, vmax=None, subtitle=None): def _plot(self, data, years, months, vmin=None, vmax=None, subtitle=None):
fig, ax = plt.subplots(figsize=(max(data.shape[1] / 5.5, 12), max(data.shape[0] / 3, 2))) fig, ax = plt.subplots(figsize=(max(data.shape[1] / 5.5, 12), max(data.shape[0] / 3.5, 2)))
data.sort_index(inplace=True) data.sort_index(inplace=True)
sns.heatmap(data, linewidths=1, cmap="coolwarm", ax=ax, vmin=vmin, vmax=vmax, sns.heatmap(data, linewidths=1, cmap="coolwarm", ax=ax, vmin=vmin, vmax=vmax,
cbar_kws={"aspect": self._aspect_cbar(data.shape[0])}) cbar_kws={"aspect": self._aspect_cbar(data.shape[0])})
# or cmap="Spectral_r", cmap="RdYlBu_r", cmap="coolwarm", # or cmap="Spectral_r", cmap="RdYlBu_r", cmap="coolwarm",
# square=True # square=True
# , cbar_kws={"aspect": 10}
self._set_ticks(ax, years, months) self._set_ticks(ax, years, months)
# ax.set_xlabel(None)
# ax.set_ylabel(None)
# plt.title(self.title if subtitle is None else f"{subtitle}\n{self.title}")
ax.set(xlabel=None, ylabel=None, title=self.title if subtitle is None else f"{subtitle}\n{self.title}") ax.set(xlabel=None, ylabel=None, title=self.title if subtitle is None else f"{subtitle}\n{self.title}")
plt.tight_layout() plt.tight_layout()
self._save() self._save()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment