diff --git a/extreme_data/meteo_france_data/scm_models_data/abstract_study.py b/extreme_data/meteo_france_data/scm_models_data/abstract_study.py index b48d95891efaa342096f4b990f627b9bd3cdebc1..e6de599ebf7334a5468d1e1faccd135d89e13b66 100644 --- a/extreme_data/meteo_france_data/scm_models_data/abstract_study.py +++ b/extreme_data/meteo_france_data/scm_models_data/abstract_study.py @@ -499,6 +499,7 @@ class AbstractStudy(object): ticks_values_and_labels=None, massif_name_to_text=None, fontsize_label=15, + add_legend=True, ): if ax is None: ax = plt.gca() @@ -588,7 +589,7 @@ class AbstractStudy(object): plt.axis('off') # Add legend for the marker - if massif_name_to_marker_style is not None: + if add_legend and massif_name_to_marker_style is not None: legend_elements = cls.get_legend_for_model_symbol(marker_style_to_label_name, markersize=7) ax.legend(handles=legend_elements[:], loc='upper right', prop={'size': 9}) # ax.legend(handles=legend_elements[4:], bbox_to_anchor=(0.01, 0.03), loc='lower left') diff --git a/extreme_trend/visualizers/study_visualizer_for_non_stationary_trends.py b/extreme_trend/visualizers/study_visualizer_for_non_stationary_trends.py index d46c8ffd58f5cd873097f3108485d21c54899925..683a73bdd99eebadff62acd811a3a1157464bef0 100644 --- a/extreme_trend/visualizers/study_visualizer_for_non_stationary_trends.py +++ b/extreme_trend/visualizers/study_visualizer_for_non_stationary_trends.py @@ -220,7 +220,8 @@ class StudyVisualizerForNonStationaryTrends(StudyVisualizer): cmap=self.cmap, show=False, ticks_values_and_labels=self.ticks_values_and_labels, - label=self.label) + label=self.label, + add_legend=False) ax.get_xaxis().set_visible(True) ax.set_xticks([]) ax.set_xlabel('Altitude = {}m'.format(self.study.altitude), fontsize=15) diff --git a/projects/exceeding_snow_loads/section_results/main_result_trends_and_return_levels.py b/projects/exceeding_snow_loads/section_results/main_result_trends_and_return_levels.py index 14ca7aba93ae53fa8182868eb701ffc56105e859..cf18102b3c9227c8ec17040a63b99e6fca1cb2ed 100644 --- a/projects/exceeding_snow_loads/section_results/main_result_trends_and_return_levels.py +++ b/projects/exceeding_snow_loads/section_results/main_result_trends_and_return_levels.py @@ -72,7 +72,8 @@ def intermediate_result(altitudes, massif_names=None, _ = compute_minimized_aic(visualizer) # Plots - # plot_trend_map(altitude_to_visualizer) + + plot_trend_map(altitude_to_visualizer) plot_trend_curves(altitude_to_visualizer={a: v for a, v in altitude_to_visualizer.items() if a >= 900}) # plot_uncertainty_massifs(altitude_to_visualizer) # plot_uncertainty_histogram(altitude_to_visualizer) @@ -94,7 +95,7 @@ def major_result(): altitudes = [300, 600, 900, 1800, 2700][:] altitudes = [300, 600, 900, 1200, 1500, 1800][2:] altitudes = paper_altitudes - # altitudes = [900, 1800, 270{{0][:1] + # altitudes = [900, 1800, 2700][:] for study_class in study_classes: print('new stuy class', study_class) if study_class is CrocusSnowLoadEurocode: diff --git a/projects/exceeding_snow_loads/section_results/plot_trend_curves.py b/projects/exceeding_snow_loads/section_results/plot_trend_curves.py index 54db2b026861121cb13d48d0b9c77019e7ad9550..4ab2b89d7a17f8989dc52d019095ee7e60b2c548 100644 --- a/projects/exceeding_snow_loads/section_results/plot_trend_curves.py +++ b/projects/exceeding_snow_loads/section_results/plot_trend_curves.py @@ -56,7 +56,7 @@ def plot_trend_curves(altitude_to_visualizer: Dict[int, StudyVisualizerForNonSta ax.bar(altitudes, percent_decrease_signi, width=width, color=color, edgecolor='black', label='significant decreasing trend', linewidth=linewidth) - ax.legend(loc='upper center', prop={'size': legend_size}) + ax.legend(loc='upper left', prop={'size': legend_size}) for ax_horizontal in [ax, ax_twiny]: if ax_horizontal == ax_twiny: diff --git a/projects/exceeding_snow_loads/utils.py b/projects/exceeding_snow_loads/utils.py index dd14d6673492f719ef6e60c07d44ff83bea27950..e63910e0a070275fff78aeeba533c7591990f7ff 100644 --- a/projects/exceeding_snow_loads/utils.py +++ b/projects/exceeding_snow_loads/utils.py @@ -23,11 +23,18 @@ paper_study_classes = [CrocusSnowLoadTotal, CrocusSnowLoadEurocode][:] # dpi_paper1_figure = 700 dpi_paper1_figure = None NON_STATIONARY_TREND_TEST_PAPER_1 = [GumbelVersusGumbel, - GumbelLocationTrendTest, GumbelScaleTrendTest, - GumbelLocationAndScaleTrendTest, GevStationaryVersusGumbel, - GevLocationAgainstGumbel, GevScaleAgainstGumbel, - GevLocationAndScaleTrendTestAgainstGumbel] + + GumbelLocationTrendTest, + GevLocationAgainstGumbel, + + GumbelScaleTrendTest, + GevScaleAgainstGumbel, + + GumbelLocationAndScaleTrendTest, + GevLocationAndScaleTrendTestAgainstGumbel, + + ] ALTITUDE_TO_GREY_MASSIF = { 300: ['Devoluy', 'Queyras', 'Champsaur', 'Grandes-Rousses', 'Ubaye', 'Pelvoux', 'Haute-Maurienne', 'Maurienne', 'Vanoise', 'Thabor', 'Mercantour', 'Haut_Var-Haut_Verdon', 'Haute-Tarentaise', 'Parpaillon', 'Belledonne', 'Oisans'],