Commit c22ea073 authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[contrasting] final odifications for the second round of review for NHESS

parent 697d0e80
No related merge requests found
Showing with 15 additions and 7 deletions
+15 -7
...@@ -339,7 +339,8 @@ class StudyVisualizer(VisualizationParameters): ...@@ -339,7 +339,8 @@ class StudyVisualizer(VisualizationParameters):
def visualize_max_graphs_poster(self, massif_name, altitude, snow_abbreviation, color, def visualize_max_graphs_poster(self, massif_name, altitude, snow_abbreviation, color,
label=None, last_plot=True, ax=None, linestyle=None, label=None, last_plot=True, ax=None, linestyle=None,
tight_pad=None, dpi=None, linewidth=5): tight_pad=None, dpi=None, linewidth=5,
legend_size=None):
massif_names = self.study.study_massif_names massif_names = self.study.study_massif_names
# Display the graph of the max on top # Display the graph of the max on top
if ax is None: if ax is None:
...@@ -355,12 +356,17 @@ class StudyVisualizer(VisualizationParameters): ...@@ -355,12 +356,17 @@ class StudyVisualizer(VisualizationParameters):
ax.tick_params(axis='both', which='major', labelsize=13) ax.tick_params(axis='both', which='major', labelsize=13)
plot_name = 'Annual maxima of {} in {} at {}m'.format(snow_abbreviation, massif_name, altitude) plot_name = 'Annual maxima of {} in {} at {}m'.format(snow_abbreviation, massif_name, altitude)
self.plot_name = plot_name self.plot_name = plot_name
ax.set_ylabel('{} ({})'.format(snow_abbreviation, self.study.variable_unit), fontsize=15) fontsize = 15
ax.set_xlabel('years', fontsize=15) ax.set_ylabel('{} ({})'.format(snow_abbreviation, self.study.variable_unit), fontsize=fontsize)
ax.set_xlabel('years', fontsize=fontsize)
if label is None and massif_name is not None: if label is None and massif_name is not None:
ax.set_title('{} at {} m'.format(massif_name, altitude)) ax.set_title('{} at {} m'.format(massif_name, altitude))
if last_plot: if last_plot:
ax.legend() if legend_size is None:
ax.legend()
else:
ax.legend(prop={'size': legend_size})
self.show_or_save_to_file(add_classic_title=False, no_title=True, self.show_or_save_to_file(add_classic_title=False, no_title=True,
tight_layout=True, tight_pad=tight_pad, tight_layout=True, tight_pad=tight_pad,
......
...@@ -42,6 +42,8 @@ def max_graph_annual_maxima_comparison(): ...@@ -42,6 +42,8 @@ def max_graph_annual_maxima_comparison():
('mediumpurple', 2700), ('mediumpurple', 2700),
][:] ][:]
ax = plt.gca() ax = plt.gca()
legend_size = 14
for color, altitude in marker_altitude: for color, altitude in marker_altitude:
for study in study_iterator_global([study_class], altitudes=[altitude]): for study in study_iterator_global([study_class], altitudes=[altitude]):
study_visualizer = StudyVisualizer(study, save_to_file=save_to_file, study_visualizer = StudyVisualizer(study, save_to_file=save_to_file,
...@@ -49,9 +51,9 @@ def max_graph_annual_maxima_comparison(): ...@@ -49,9 +51,9 @@ def max_graph_annual_maxima_comparison():
multiprocessing=True) multiprocessing=True)
snow_abbreviation = SCM_STUDY_CLASS_TO_ABBREVIATION[study_class] snow_abbreviation = SCM_STUDY_CLASS_TO_ABBREVIATION[study_class]
nb_massifs = len(study_visualizer.study.study_massif_names) nb_massifs = len(study_visualizer.study.study_massif_names)
label = 'Mean value at {}m (out of {} massifs)'.format(altitude, nb_massifs) label = 'Mean at {}m ({} massifs)'.format(altitude, nb_massifs)
study_visualizer.visualize_max_graphs_poster(None, altitude, snow_abbreviation, color, label, study_visualizer.visualize_max_graphs_poster(None, altitude, snow_abbreviation, color, label,
False, ax) False, ax, legend_size=legend_size)
last_plot = altitude == 2700 last_plot = altitude == 2700
if last_plot: if last_plot:
...@@ -59,7 +61,7 @@ def max_graph_annual_maxima_comparison(): ...@@ -59,7 +61,7 @@ def max_graph_annual_maxima_comparison():
# label = '{} for French standards'.format(snow_density_str) # label = '{} for French standards'.format(snow_density_str)
# snow_density_eurocode = [150 for _ in study.ordered_years] # snow_density_eurocode = [150 for _ in study.ordered_years]
# ax.plot(study.ordered_years, snow_density_eurocode, color='k', label=label) # ax.plot(study.ordered_years, snow_density_eurocode, color='k', label=label)
ax.legend() ax.legend(prop={'size': legend_size})
tight_pad = {'h_pad': 0.2} tight_pad = {'h_pad': 0.2}
ax.set_ylim(ylim) ax.set_ylim(ylim)
ax.set_xlim([1957, 2018]) ax.set_xlim([1957, 2018])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment