diff --git a/mlair/plotting/postprocessing_plotting.py b/mlair/plotting/postprocessing_plotting.py index afbd00d0e84f1478c3b43bc57af19752e05eefef..5bd4ab1bdc127d18dcb096508d9be0ff4853b7b6 100644 --- a/mlair/plotting/postprocessing_plotting.py +++ b/mlair/plotting/postprocessing_plotting.py @@ -1192,8 +1192,9 @@ class PlotSampleUncertaintyFromBootstrap(AbstractPlotClass): # pragma: no cover else: xy = (self.model_type_dim, 0) if orientation == "v" else (0, self.model_type_dim) col_or_row = {"col": self.ahead_dim} if orientation == "v" else {"row": self.ahead_dim} - aspect = 0.4 if orientation == "v" else 5./3. - ax = sns.FacetGrid(data_table.stack(self.model_type_dim).reset_index(), **col_or_row, aspect=aspect, height=5) + aspect = figsize[0] / figsize[1] + height = figsize[1] * 0.8 + ax = sns.FacetGrid(data_table.stack(self.model_type_dim).reset_index(), **col_or_row, aspect=aspect, height=height) ax.map(sns.boxplot, *xy, whis=1.5, color="white", showmeans=True, order=data_table.mean().index.to_list(), meanprops={"markersize": 6, "markeredgecolor": "k"}, flierprops={"marker": "o", "markerfacecolor": "black", "markeredgecolor": "none", "markersize": 3}, diff --git a/mlair/plotting/tracker_plot.py b/mlair/plotting/tracker_plot.py index 53ec7496e7e04da0f53b1d0ce817793dea732963..5c5887a6e1f9b03ed06ade49a49cd70edc51e820 100644 --- a/mlair/plotting/tracker_plot.py +++ b/mlair/plotting/tracker_plot.py @@ -319,8 +319,12 @@ class TrackPlot: x_max = None if chain.successor is not None: + stage_count = 0 for e in chain.successor: if e.stage == stage: + stage_count += 1 + if stage_count > 50: + continue shift = self.width + self.space_intern_x if chain.stage == e.stage else 0 x_tmp = self.plot_track_chain(e, y_pos, x_pos + shift, prev=(x, y), stage=stage, sparse_conn_mode=sparse_conn_mode) diff --git a/mlair/run_modules/run_environment.py b/mlair/run_modules/run_environment.py index 2bc81750bf86d60e0c59bbf0fef68ae9c29138c9..9edb0aa27379cc2477e0240c43e4745ab5db1ce2 100644 --- a/mlair/run_modules/run_environment.py +++ b/mlair/run_modules/run_environment.py @@ -8,6 +8,7 @@ import logging import os import shutil import time +import sys from mlair.helpers.datastore import DataStoreByScope as DataStoreObject from mlair.helpers.datastore import NameNotFoundInDataStore @@ -160,8 +161,12 @@ class RunEnvironment(object): json.dump(tracker, f) def __plot_tracking(self): - plot_folder, plot_name = os.path.split(self.__find_file_pattern("tracking_%03i.pdf")) - TrackPlot(self.tracker_list, sparse_conn_mode=True, plot_folder=plot_folder, plot_name=plot_name) + try: + plot_folder, plot_name = os.path.split(self.__find_file_pattern("tracking_%03i.pdf")) + TrackPlot(self.tracker_list, sparse_conn_mode=True, plot_folder=plot_folder, plot_name=plot_name) + except Exception as e: + logging.info(f"Could not plot tracking plot due to:\n{sys.exc_info()[0]}\n" + f"{sys.exc_info()[1]}\n{sys.exc_info()[2]}") def __find_file_pattern(self, name): counter = 0