diff --git a/mlair/plotting/postprocessing_plotting.py b/mlair/plotting/postprocessing_plotting.py index 8d3be27ad6f1e7908041c7b5135ba965030ad8bf..c349f01309246a1affe60a20f6783b28237f636d 100644 --- a/mlair/plotting/postprocessing_plotting.py +++ b/mlair/plotting/postprocessing_plotting.py @@ -1018,17 +1018,18 @@ class PlotSampleUncertaintyFromBootstrap(AbstractPlotClass): fig, ax = plt.subplots(figsize=(size, size * 0.8)) sns.boxplot(data=data_table, ax=ax, whis=1., color="white", showmeans=True, meanprops={"markersize": 3, "markeredgecolor": "k"}, - flierprops={"marker": ".", "markerfacecolor": 'black', "markeredgecolor": 'none'}, + flierprops={"marker": "o", "markerfacecolor": "black", "markeredgecolor": "none","markersize": 3}, + boxprops={'facecolor': 'none', 'edgecolor': 'k'}, width=.3) ax.set_ylabel(f"{self.error_measure} (in {self.error_unit})") ax.set_xticklabels(ax.get_xticklabels(), rotation=45) text_box = AnchoredText(f"n={n_boots}", frameon=True, loc=4, pad=0.5) - plt.setp(text_box.patch, facecolor='white', alpha=0.5) + plt.setp(text_box.patch, edgecolor='k', facecolor='w') ax.add_artist(text_box) + plt.setp(ax.lines, color='k') plt.tight_layout() self._save() -# a = xr.DataArray(np.array(range(20)).reshape(2,-1).T, dims={'time':range(10), 'model': ['m1', 'm2']}, coords={'time':range(10), 'model': ['m1', 'm2']}) -# data = create_n_bootstrap_realizations(a, dim_name_time='time', dim_name_model='model', n_boots=100) + if __name__ == "__main__": stations = ['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087'] diff --git a/mlair/run_modules/post_processing.py b/mlair/run_modules/post_processing.py index 3ad82811de2858f4d42664e06fbfd1b337bb96e4..22593d8b10333875384106a886740170d0ce913a 100644 --- a/mlair/run_modules/post_processing.py +++ b/mlair/run_modules/post_processing.py @@ -576,7 +576,7 @@ class PostProcessing(RunEnvironment): PlotSampleUncertaintyFromBootstrap( data=self.uncertainty_estimate, plot_folder=self.plot_path, model_type_dim=self.model_type_dim, dim_name_boots=self.uncertainty_estimate_boot_dim, error_measure="mean squared error", - error_unit=r"ppb^2") + error_unit=r"ppb$^2$") except Exception as e: logging.error(f"Could not create plot PlotSampleUncertaintyFromBootstrap due to the following error: {e}" f"\n{sys.exc_info()[0]}\n{sys.exc_info()[1]}\n{sys.exc_info()[2]}") diff --git a/test/test_configuration/test_defaults.py b/test/test_configuration/test_defaults.py index c21dba4895757711deec77f2b9bf1fe65b8b8ffb..8644181185203186bb6c8549e8faa99e75a31a81 100644 --- a/test/test_configuration/test_defaults.py +++ b/test/test_configuration/test_defaults.py @@ -74,6 +74,6 @@ class TestAllDefaults: assert DEFAULT_PLOT_LIST == ["PlotMonthlySummary", "PlotStationMap", "PlotClimatologicalSkillScore", "PlotTimeSeries", "PlotCompetitiveSkillScore", "PlotBootstrapSkillScore", "PlotConditionalQuantiles", "PlotAvailability", "PlotAvailabilityHistogram", - "PlotDataHistogram", "PlotPeriodogram"] + "PlotDataHistogram", "PlotPeriodogram", "PlotSampleUncertaintyFromBootstrap"]