-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfigure_3.py
61 lines (47 loc) · 1.81 KB
/
figure_3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -*- coding: utf-8 -*-
"""
Created on Th December 1 2022
@author: davidsantiagoquevedo
@author: ntorresd
"""
import warnings
warnings.filterwarnings('ignore')
import sys
import yaml
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
config = yaml.load(open("config.yml", "r"))["default"]
SCRIPTS_PATH = config['PATHS']['PLOT_PATH']
FIG_PATH = config['PATHS']['FIG_PATH'].format(dir = 'plots')
sys.path.append(SCRIPTS_PATH)
import results_severe_outcomes as results_severe_outcomes
fig, ax = plt.subplots(2, 3, figsize=(12, 8), sharex = True)
results_severe_outcomes.plot_ratios(ax=ax[0][1], var='HCR', var_name='HCR')
results_severe_outcomes.plot_ratios(ax=ax[0][2], var='ICU-CR', var_name=' ICU-CR')
results_severe_outcomes.plot_ratios(ax=ax[1][0], var='CFR', var_name='CFR')
results_severe_outcomes.plot_ratios(ax=ax[1][1], var='HFR', var_name='HFR')
results_severe_outcomes.plot_ratios(ax=ax[1][2], var='ICU-FR', var_name='ICU-FR')
handles, labels = ax[1][1].get_legend_handles_labels()
ax[0][0].legend(handles, labels, loc='center')
ax[0][0].axis('off')
ax[0][1].tick_params(axis='x', rotation=90)
ax[0][2].tick_params(axis='x', rotation=90)
ax[1][0].tick_params(axis='x', rotation=90)
ax[1][1].tick_params(axis='x', rotation=90)
ax[1][2].tick_params(axis='x', rotation=90)
ax[0][1].set_title('a.')
ax[0][2].set_title('b.')
ax[1][0].set_title('c.')
ax[1][1].set_title('d.')
ax[1][2].set_title('e.')
ax[0][1].set_xlabel('')
ax[0][2].set_xlabel('')
ax[1][0].set_xlabel('Age group')
ax[1][1].set_xlabel('Age group')
ax[1][2].set_xlabel('Age group')
ax[0][1].set_ylabel('Hospitalisation Case Ratio')
ax[0][2].set_ylabel('ICU Case Ratio')
ax[1][0].set_ylabel('Case Fatality Ratio')
ax[1][1].set_ylabel('Hospitalisation Fatality Ratio')
ax[1][2].set_ylabel('ICU Fatality Ratio')
fig.savefig(FIG_PATH + 'figure_3.png')