diff --git a/mlair/plotting/postprocessing_plotting.py b/mlair/plotting/postprocessing_plotting.py index 751282eb59633c401138d64312a8528c0bb98a73..68d31846f1e9fd21493bb718603f8e2fc28c0b3b 100644 --- a/mlair/plotting/postprocessing_plotting.py +++ b/mlair/plotting/postprocessing_plotting.py @@ -1302,19 +1302,25 @@ class PlotTimeEvolutionMetric(AbstractPlotClass): return min(max(1.25 * val + 7.5, 10), 30) def _plot(self, data, years, months, vmin=None, vmax=None, subtitle=None): - fig, ax = plt.subplots(figsize=(max(data.shape[1] / 5, 12), max(data.shape[0] / 3, 2))) - data.sort_index(inplace=True) - sns.heatmap(data, linewidths=1, cmap="coolwarm", ax=ax, vmin=vmin, vmax=vmax, - cbar_kws={"aspect": self._aspect_cbar(data.shape[0])}) - # or cmap="Spectral_r", cmap="RdYlBu_r", cmap="coolwarm", - # square=True - # , cbar_kws={"aspect": 10} - 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}") - plt.tight_layout() - self._save() + plot_name = self.plot_name + for c in ["Spectral_r", "RdYlBu_r", "coolwarm"]: + self.plot_name = plot_name + "_" + c + fig, ax = plt.subplots(figsize=(max(data.shape[1] / 5, 12), max(data.shape[0] / 3, 2))) + data.sort_index(inplace=True) + # sns.heatmap(data, linewidths=1, cmap="coolwarm", ax=ax, vmin=vmin, vmax=vmax, + # cbar_kws={"aspect": self._aspect_cbar(data.shape[0])}) + sns.heatmap(data, linewidths=1, cmap=c, ax=ax, vmin=vmin, vmax=vmax, + cbar_kws={"aspect": self._aspect_cbar(data.shape[0])}) + # or cmap="Spectral_r", cmap="RdYlBu_r", cmap="coolwarm", + # square=True + # , cbar_kws={"aspect": 10} + 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}") + plt.tight_layout() + self._save() if __name__ == "__main__":