Commit 2e23b14b authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[PAPER 1] fix data plots

parent 18def57d
No related merge requests found
Showing with 16 additions and 5 deletions
+16 -5
# Eurocode quantile str # Eurocode quantile str
EUROCODE_RETURN_LEVEL_STR = '50-year return level of SL (kN $m^-2$)' EUROCODE_RETURN_LEVEL_STR = '50-year return level of GSL (kN $m^-2$)'
# Eurocode quantile correspond to a 50 year return period # Eurocode quantile correspond to a 50 year return period
EUROCODE_QUANTILE = 0.98 EUROCODE_QUANTILE = 0.98
# Altitudes (between low and mid altitudes) < 2000m and should be > 200m # Altitudes (between low and mid altitudes) < 2000m and should be > 200m
......
...@@ -639,7 +639,7 @@ class StudyVisualizer(VisualizationParameters): ...@@ -639,7 +639,7 @@ 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('{} (in {})'.format(snow_abbreviation, self.study.variable_unit), fontsize=15) ax.set_ylabel('{} ({})'.format(snow_abbreviation, self.study.variable_unit), fontsize=15)
ax.set_xlabel('years', fontsize=15) ax.set_xlabel('years', fontsize=15)
if label is None: if label is None:
ax.set_title('{} at {} m'.format(massif_name, altitude)) ax.set_title('{} at {} m'.format(massif_name, altitude))
......
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from copy import deepcopy, copy
import numpy as np import numpy as np
from experiment.eurocode_data.eurocode_region import C2, E, C1 from experiment.eurocode_data.eurocode_region import C2, E, C1
...@@ -16,16 +17,24 @@ def main_eurocode_norms(ax=None): ...@@ -16,16 +17,24 @@ def main_eurocode_norms(ax=None):
altitudes = np.linspace(200, 2000) altitudes = np.linspace(200, 2000)
for region_class in [C1, C2, E][:]: for region_class in [C1, C2, E][:]:
region_object = region_class() region_object = region_class()
label = get_display_name_from_object_type(region_class) + ' Eurocode region' label = get_display_name_from_object_type(region_class) + ' Eurocodes region'
linestyle = '--' if region_class == C2 else '-' linestyle = '--' if region_class == C2 else '-'
region_object.plot_eurocode_snow_load_on_ground_characteristic_value_variable_action(ax, altitudes, label=label, linestyle=linestyle) region_object.plot_eurocode_snow_load_on_ground_characteristic_value_variable_action(ax, altitudes, label=label, linestyle=linestyle)
if region_class == E: if region_class == E:
ax.legend()
ax.xaxis.set_ticks([250 * i for i in range(1, 9)]) ax.xaxis.set_ticks([250 * i for i in range(1, 9)])
ax.tick_params(axis='both', which='major', labelsize=13) ax.tick_params(axis='both', which='major', labelsize=13)
ax.set_ylabel(EUROCODE_RETURN_LEVEL_STR) ax.set_ylabel(EUROCODE_RETURN_LEVEL_STR)
ax.set_xlabel('Altitude (m)') ax.set_xlabel('Altitude (m)')
ax.set_ylim([0.0, 11.0]) ax.set_ylim([0.0, 12.0])
ax.set_yticks(list(range(0, 13, 2)))
ax.set_xlim([0, 2000])
ax.set_xticks(list(range(0, 2001, 500)))
handles, labels = ax.get_legend_handles_labels()
# Copy the handle to not modify the original plot
handle1 = copy(handles[1])
handle1.set_linestyle('-')
handles[1] = handle1
ax.legend(handles, labels)
ax.grid() ax.grid()
plt.show() plt.show()
......
...@@ -21,6 +21,8 @@ def max_graph_annual_maxima_poster(): ...@@ -21,6 +21,8 @@ def max_graph_annual_maxima_poster():
('mediumpurple', 2700, 'Beaufortain'), ('mediumpurple', 2700, 'Beaufortain'),
] ]
ax = plt.gca() ax = plt.gca()
ax.set_ylim([0, 20])
ax.set_yticks(list(range(0, 21, 2)))
for color, altitude, massif_name in marker_altitude_massif_name: for color, altitude, massif_name in marker_altitude_massif_name:
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,
......
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