Skip to content

Commit

Permalink
translate images from english to spanish
Browse files Browse the repository at this point in the history
  • Loading branch information
ntorresd committed Aug 22, 2023
1 parent e3dd267 commit 7733273
Show file tree
Hide file tree
Showing 30 changed files with 62 additions and 62 deletions.
6 changes: 3 additions & 3 deletions plots/figure_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
axi = ax[0][1]
overview.plot_pyramid(ax = axi)
axi.set_xlim(left=-270000)
axi.set_xlabel('Cases')
axi.set_ylabel('Age group')
axi.set_xlabel('Casos')
axi.set_ylabel('Grupo de edad')
axi.set_title('b.')
axi.legend(loc = 'upper left')

Expand All @@ -50,7 +50,7 @@
results_genomics.plot_prevalence(ax = axi)
axi.tick_params(axis = 'x', rotation = 90)
axi.set_xlabel('')
axi.set_ylabel('Prevalence')
axi.set_ylabel('Prevalencia')
axi.set_title('d.', loc = 'left')

fig.savefig(FIG_PATH + 'figure_1.png')
18 changes: 9 additions & 9 deletions plots/figure_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@

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')
ax[1][0].set_xlabel('Grupo de edad')
ax[1][1].set_xlabel('Grupo de edad')
ax[1][2].set_xlabel('Grupo de edad')

ax[0][1].set_ylabel('Tasa de casos hospitalizados')
ax[0][2].set_ylabel('Tasa de casos UCI')
ax[1][0].set_ylabel('Tasa de mortalidad')
ax[1][1].set_ylabel('Tasa de mortalidad hospitalaria')
ax[1][2].set_ylabel('Tasa de mortalidad ICU')

fig.savefig(FIG_PATH + 'figure_3.png')
8 changes: 4 additions & 4 deletions plots/figure_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
results_severe_outcomes.plot_percentage(ax)
# results_severe_outcomes.plot_percentage_err(ax)

ax[0].set_ylabel('Hospitalization percentage by age-group')
ax[1].set_ylabel('ICU percentage by age-group')
ax[2].set_ylabel('Deaths percentage by age-group')
ax[0].set_ylabel('Porcentaje de ingreso a hospitalización')
ax[1].set_ylabel('Porcentaje de ingreso a UCI')
ax[2].set_ylabel('Porcentaje de fallecidos')
for axi in ax:
axi.tick_params(axis='x', labelrotation=90)
axi.set_xlabel('Age group')
axi.set_xlabel('Grupo de edad')
ax[0].set_title('a.')
ax[1].set_title('b.')
ax[2].set_title('c.')
Expand Down
8 changes: 4 additions & 4 deletions plots/figure_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
red.plot_best_model_bar_outcome(3, ax, w = 0.05)
red.plot_best_model_bar_outcome(4, ax, w = 0.15)

leglabels= ['Wave 1',
'Wave 2',
'Wave 3',
'Wave 4',
leglabels= ['ola 1',
'ola 2',
'ola 3',
'ola 4',
]
ax.legend(leglabels, bbox_to_anchor=(0.75, -0.15), ncol=5)
fig.savefig(FIG_PATH + 'figure_5_v0.png')
Expand Down
Binary file modified plots/figures/CFR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/HCR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/HFR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/ICU-CR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/ICU-FR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/cases_death_cum.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/figure_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/figure_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/figure_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/figure_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/figure_4_err.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/figure_5_v0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/figure_5_v1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/hosp_icu_death_counts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/hosp_icu_death_percentages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/population_pyramid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/rt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/variants_multinomial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots/figures/waves.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions plots/individual_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
fig, ax = plt.subplots(figsize=(7.5, 5))
overview.plot_pyramid(ax)
ax.set_xlim(left=-260000)
ax.set_xlabel('Cases')
ax.set_ylabel('Age group')
ax.set_xlabel('Casos')
ax.set_ylabel('Grupo de edad')
ax.legend()
fig.savefig(FIG_PATH + 'population_pyramid.png')

Expand Down Expand Up @@ -184,12 +184,12 @@

fig, ax = plt.subplots(1, 3, figsize=(15, 5))
results_severe_outcomes.plot_percentage_err(ax)
ax[0].set_ylabel('Hospitalization percentage by age-group')
ax[1].set_ylabel('ICU percentage by age-group')
ax[2].set_ylabel('Deaths percentage by age-group')
ax[0].set_ylabel('Porcentaje de ingreso hospitalización')
ax[1].set_ylabel('Porcentaje de ingreso a UCI')
ax[2].set_ylabel('Porcentaje de fallecidos')
for axi in ax:
axi.tick_params(axis='x', labelrotation=90)
axi.set_xlabel('Age group')
axi.set_xlabel('Grupo de edad')
ax[0].set_title('a.')
ax[1].set_title('b.')
ax[2].set_title('c.')
Expand Down
22 changes: 11 additions & 11 deletions plots/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
columns=df_confirmed_bogota['sex'],
normalize="index")*100
def plot_pyramid(ax):
hist_f = ax.barh(df_female['age_group'], -df_female['counts'], align='center', label='female')
hist_m = ax.barh(df_male['age_group'], df_male['counts'], align='center', label='male')
hist_f = ax.barh(df_female['age_group'], -df_female['counts'], align='center', label='mujeres')
hist_m = ax.barh(df_male['age_group'], df_male['counts'], align='center', label='hombres')

ax.bar_label(hist_m, labels=['{:.1f}%'.format(prop) for prop in df_prop['M'].round(1)], label_type='edge')
ax.bar_label(hist_f, labels=['{:.1f}%'.format(prop) for prop in df_prop['F'].round(1)], label_type='edge')
ax.bar_label(hist_m, labels=['{:.1f}%'.format(prop) for prop in df_prop['M'].round(1)], label_type='edge', fontsize = 9)
ax.bar_label(hist_f, labels=['{:.1f}%'.format(prop) for prop in df_prop['F'].round(1)], label_type='edge', fontsize = 9)

ticks = ax.get_xticks()
ax.set_xticklabels([int(abs(tick)) for tick in ticks])
Expand All @@ -83,22 +83,22 @@ def plot_pyramid(ax):
df_deaths_60p['deaths_cum'] = df_deaths_60p['deaths'].cumsum().values

def plot_cases_death_cum(ax):
ln1 = ax.plot(df_cases_all['date'], df_cases_all['cases'], label='cases all')
ln2 = ax.plot(df_cases_60p['date'], df_cases_60p['cases'], label='cases 60+')
ln1 = ax.plot(df_cases_all['date'], df_cases_all['cases'], label='casos - todos')
ln2 = ax.plot(df_cases_60p['date'], df_cases_60p['cases'], label='casos - 60+')

# fig, ax2 =plt.subplots(figsize=(7.5, 5))
ax_twin = ax.twinx()

ln3 = ax_twin.plot(df_deaths_all['date'], df_deaths_all['deaths_cum'], label='cumulative deaths all', linestyle='dashed')
ln4 = ax_twin.plot(df_deaths_60p['date'], df_deaths_60p['deaths_cum'], label='cumulative deaths 60+', linestyle='dashed')
ln3 = ax_twin.plot(df_deaths_all['date'], df_deaths_all['deaths_cum'], label='fallecimientos acum - todos', linestyle='dashed')
ln4 = ax_twin.plot(df_deaths_60p['date'], df_deaths_60p['deaths_cum'], label='fallecimientos acum - 60+', linestyle='dashed')

lns = ln1 + ln2 + ln3 + ln4
labs = [l.get_label() for l in lns]

ax.tick_params(axis='x', rotation=90)
ax.set_ylabel('Confirmed cases')
ax.set_ylabel('Casos confirmados')

ax_twin.legend(lns, labs, loc='upper left', frameon=False, fontsize=10)
ax_twin.legend(lns, labs, loc='upper left', frameon=False, fontsize=9)
ax_twin.spines.right.set_visible(True) #This was set as False by default in the .mpstyle file
ax_twin.tick_params(axis='x', rotation=90)
ax_twin.set_ylabel('Deaths')
ax_twin.set_ylabel('Fallecimientos')
18 changes: 9 additions & 9 deletions plots/results_epidemiological_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,16 @@ def plot_best_model_bar_all(dist, ax, w, n, wt=0.1):
color = colors[n])
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
#ax.set_yscale('log')
ax.set_ylabel('Average value of delay time (Days)')
ax.set_xlabel('Wave')
ax.set_ylabel('Media del tiempo de estancia (días)')
ax.set_xlabel('Ola')

def plot_best_model_bar_outcome(wave, ax, w, wt=0.1):
dist = ['onset_hosp', 'onset_icu', 'onset_death', 'hosp_stay', 'icu_stay']
xlabels= ['Onset to hospitalisation',
'Onset to ICU entrance',
'Onset to death',
'Hospital stay',
'ICU stay']
xlabels= ['FIS - hospitalización',
'FIS - ingreso UCI',
'FIS - fallecimiento',
'Estancia en hospitalización',
'Estancia en UCI']
mean = []
err = [[],[]]
for d in dist:
Expand All @@ -259,6 +259,6 @@ def plot_best_model_bar_outcome(wave, ax, w, wt=0.1):
color = colors[n])
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
#ax.set_yscale('log')
ax.set_ylabel('Average value of delay time (Days)')
ax.set_xlabel('Epidemiological distribution')
ax.set_ylabel('Media del tiempos de estancia (días)')
ax.set_xlabel('Distribuciones epidemiológicas')
ax.set_xticks([1,2,3,4,5], xlabels)
8 changes: 4 additions & 4 deletions plots/results_genomics.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def plot_multinomial(ax, limits):
df_incidence_count = df_incidence_count.sort_values(by = 'week_date')

l1 = ax.bar(df_incidence_count['week_date'], df_incidence_count['cases'],
alpha = 0.3, color = "grey", width=5.3, label = 'Weekly new cases')
ax.set_ylabel('Incidence')
alpha = 0.3, color = "grey", width=5.3, label = 'Casos nuevos semanales')
ax.set_ylabel('Incidencia')
ax.tick_params(axis='x', rotation=90)
ax.xaxis.set_major_locator(plt.MaxNLocator(n_ticks))
labs = ['Weekly new cases']
labs = ['Casos nuevos semanales']

# Prevalence - Observed
ax1 = ax.twinx()
Expand Down Expand Up @@ -168,7 +168,7 @@ def plot_multinomial(ax, limits):
ax1.tick_params(axis='x', rotation=90)
ax1.xaxis.set_major_locator(plt.MaxNLocator(n_ticks))
ax1.spines.right.set_visible(True)
ax1.set_ylabel('Prevalence', rotation = 270, labelpad = 15)
ax1.set_ylabel('Prevalencia', rotation = 270, labelpad = 15)

handles = ax.containers + ax1.get_lines()
labels1, handles1 = ax1.get_legend_handles_labels()
Expand Down
2 changes: 1 addition & 1 deletion plots/results_rt.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

# Instantaneous reproduction number R(t) plot
def plot_rt(ax):
ln1 = ax.plot(df_rt_all['window_end'], df_rt_all['Mean(R)'], color=colors[4], label = 'all')
ln1 = ax.plot(df_rt_all['window_end'], df_rt_all['Mean(R)'], color=colors[4], label = 'todos')
ln2 = ax.plot(df_rt_60p['window_end'], df_rt_60p['Mean(R)'], color=colors[1], label = '60+')
ax.axhline(y=1, color='black', linestyle='--', linewidth=3)

Expand Down
12 changes: 6 additions & 6 deletions plots/results_severe_outcomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# Auxiliar plot function
def plot_xyvar(df, ax, n_strat, varx='age_group', vary='percentage'):
data = df.loc[df[strat]==n_strat]
ax.plot(data[varx], data[vary], label=strat+str(n_strat), ls = '-', marker = ".", lw = 1)
ax.plot(data[varx], data[vary], label='ola '+str(n_strat), ls = '-', marker = ".", lw = 1)

# Wave cases percentage distribution by age group
def plot_percentage(ax):
Expand All @@ -54,8 +54,8 @@ def plot_counts(ax):
strat_list = df_ratios[strat].unique()
for axi in ax:
axi.tick_params(axis='x', labelrotation=90)
axi.set_ylabel('cases')
axi.set_xlabel('age group')
axi.set_ylabel('casos')
axi.set_xlabel('grupo de edad')
for wave in strat_list:
plot_xyvar(df_ratios[[strat, 'age_group','hosp']], ax=ax[0], n_strat=wave, vary='hosp')
plot_xyvar(df_ratios[[strat, 'age_group', 'icu']], ax=ax[1], n_strat=wave, vary='icu')
Expand Down Expand Up @@ -123,9 +123,9 @@ def plot_ratios(ax, var, var_name):
ratio_upper = df_temp[var+'_upper'] - ratio
yerr = np.array(list(zip(ratio_lower, ratio_upper))).T
ax.errorbar(df_temp['age_group'], df_temp[var], yerr = yerr,
fmt='o', color = colors[wave-1], label = 'wave '+str(wave),
fmt='o', color = colors[wave-1], label = 'ola '+str(wave),
capsize = 5, ls = '-', marker = ".", lw = 1)
ax.set_xlabel('age group')
ax.set_xlabel('grupo de edad')
ax.set_ylabel(var_name)

# Plot variable with error bar
Expand All @@ -137,7 +137,7 @@ def plot_var_err(df, axi, var):
data_upper = df_temp[var + '_upper'] - data
yerr = np.array(list(zip(data_lower, data_upper))).T
axi.errorbar(df_temp['age_group'], df_temp[var], yerr = yerr,
fmt='o', color = colors[wave-1], label = 'wave '+str(wave),
fmt='o', color = colors[wave-1], label = 'ola '+str(wave),
capsize = 5, ls = '-', marker = ".", lw = 1)

# Plot percentages with erros
Expand Down
10 changes: 5 additions & 5 deletions plots/results_waves.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@
# Function to plot waves figure
def plot_waves(ax):
# Confirmed cases curve
ln1 = ax.plot(df_counts['date'], df_counts['cases'], color = colors[0], label = 'confirmed cases')
ln1 = ax.plot(df_counts['date'], df_counts['cases'], color = colors[0], label = 'casos confirmados')
ln2 = ax.plot(df_counts['date'], df_counts['cases_gs'], color= colors[2], ls = '--')
date_no_dup = []
for d in range(len(df_waves)):
ax.axvline(x = df_waves['start_date'].iloc[d], color = 'black', alpha = 0.8, ls = '--')
ax.axvline(x = df_waves['end_date'].iloc[d], color = 'black', alpha = 0.8, ls = '--')
date_no_dup.append(d)
ax.set_ylabel('Confirmed cases')
ax.set_ylabel('Casos confirmados')
# First difference plot
ax2 = ax.twinx()
ln3 = ax2.plot(df_counts['date'],df_counts['cases_gs_diff'], colors[1], label = 'diff(confirmed cases)')
ln4 = ax2.plot(df_counts['date'],df_counts['cases_gs_diff_gs'], colors[2], ls = '--', label = 'gaussian smoothing')
ln3 = ax2.plot(df_counts['date'],df_counts['cases_gs_diff'], colors[1], label = 'diff(casos confirmados)')
ln4 = ax2.plot(df_counts['date'],df_counts['cases_gs_diff_gs'], colors[2], ls = '--', label = 'suavizamiento gaussiano')

ax2.axhline(y = 0, color = 'black', alpha = 0.8, ls = '--')
ax2.set_ylabel('diff(Confirmed cases)')
ax2.set_ylabel('diff(Casos confirmados)')
ax2.spines.right.set_visible(True) #This was set as False by default in the .mpstyle file

##Legend
Expand Down

0 comments on commit 7733273

Please sign in to comment.