From 697d0e80982423a4c38a3f2bec8212446fd6f8a1 Mon Sep 17 00:00:00 2001
From: Le Roux Erwan <erwan.le-roux@irstea.fr>
Date: Wed, 9 Sep 2020 17:38:07 +0200
Subject: [PATCH] [contrasting] add more figure modifications for the second
 round of review for NHESS

---
 .../scm_models_data/abstract_study.py             |  3 ++-
 .../study_visualizer_for_non_stationary_trends.py |  3 ++-
 .../main_result_trends_and_return_levels.py       |  5 +++--
 .../section_results/plot_trend_curves.py          |  2 +-
 projects/exceeding_snow_loads/utils.py            | 15 +++++++++++----
 5 files changed, 19 insertions(+), 9 deletions(-)

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 b48d9589..e6de599e 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 d46c8ffd..683a73bd 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 14ca7aba..cf18102b 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 54db2b02..4ab2b89d 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 dd14d667..e63910e0 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'],
-- 
GitLab