From 293f8d6b7646cf760ee459d1857ad956ec794e62 Mon Sep 17 00:00:00 2001 From: Andrejh Date: Mon, 21 Feb 2022 10:41:06 +0100 Subject: [PATCH 1/8] legend updates --- cara/short_range_plots/scripts.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cara/short_range_plots/scripts.py b/cara/short_range_plots/scripts.py index de456b0b..72a54441 100644 --- a/cara/short_range_plots/scripts.py +++ b/cara/short_range_plots/scripts.py @@ -22,8 +22,8 @@ from mpl_toolkits.axes_grid1.inset_locator import mark_inset ######### Plot material ######### np.random.seed(2000) SAMPLE_SIZE = 250000 -TIMESTEP = 0.01 -viral_loads = np.linspace(2, 12, 600) +TIMESTEP = 0.1 +#viral_loads = np.linspace(2, 12, 600) _VectorisedFloat = typing.Union[float, np.ndarray] @@ -59,7 +59,7 @@ def previous_deposited_exposure_between_bounds(model: ExposureModel, time1: floa (1 - model.exposed.mask.inhale_efficiency())) -def concentration_curve(models, labels, colors, linestyles, thickness): +def concentration_curve(models, labels, labelsDose, colors, linestyles, thickness): exp_models = [model.build_model(size=SAMPLE_SIZE) for model in models] @@ -129,10 +129,10 @@ def concentration_curve(models, labels, colors, linestyles, thickness): ax1.spines["right"].set_linestyle((0, (1, 5))) - ax1.set_ylabel('Mean cumulative dose (virions)', fontsize=14) + ax1.set_ylabel('Mean cumulative dose\n(infectious virus)', fontsize=14) ax1.set_ylim(ax1.get_ylim()[0], ax1.get_ylim()[1] * 1.3) - complete_labels = labels + ['vD - ' + label for label in labels] + complete_labels = labels + [label for label in labelsDose] complete_colors = colors + [color for color in colors] complete_linestyles = linestyles + ['dotted' for linestyle in linestyles] @@ -146,7 +146,7 @@ def concentration_curve(models, labels, colors, linestyles, thickness): f"5th per = {quantile_05[i][-1]}\n" f"95th per = {quantile_95[i][-1]}\n") - plt.legend(handles=labels_legend, loc='upper right', bbox_to_anchor=(1, 1)) + plt.legend(handles=labels_legend, loc='upper left') plt.show() def plot_pi_vs_exposure_time(exp_models: typing.List[mc.ExposureModel], From a594b67528b8f017603614cced8d7e76d4a2a6de Mon Sep 17 00:00:00 2001 From: Andrejh Date: Mon, 21 Feb 2022 10:41:21 +0100 Subject: [PATCH 2/8] change to omicron --- cara/short_range_plots/model_scenarios.py | 57 +++++++++++++++++------ 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/cara/short_range_plots/model_scenarios.py b/cara/short_range_plots/model_scenarios.py index b1444997..48d4476d 100644 --- a/cara/short_range_plots/model_scenarios.py +++ b/cara/short_range_plots/model_scenarios.py @@ -66,7 +66,7 @@ def exposure_module_without_short_range(activity: str, expiration: str, mask: st ), infected=mc.InfectedPopulation( number=1, - virus=virus_distributions['SARS_CoV_2'], + virus=virus_distributions['SARS_CoV_2_OMICRON'], presence=mc.SpecificInterval(((8.5, 12.5),(13.5, 17.5),)), mask=exposure_mask, activity=activity_distributions[activity], @@ -89,11 +89,7 @@ def exposure_module_without_short_range(activity: str, expiration: str, mask: st ) return exposure_mc -def exposure_module_with_short_range(activity: str, - expiration: str, - mask: str, - sr_presence: list, - sr_activities: list): +def exposure_module_with_short_range(activity: str, expiration: str, mask: str, sr_presence: list, sr_activities: list): if mask == 'No mask': exposure_mask = models.Mask.types['No mask'] else: @@ -108,7 +104,7 @@ def exposure_module_with_short_range(activity: str, ), infected=mc.InfectedPopulation( number=1, - virus=virus_distributions['SARS_CoV_2'], + virus=virus_distributions['SARS_CoV_2_OMICRON'], presence=mc.SpecificInterval(((8.5, 12.5),(13.5, 17.5),)), mask=exposure_mask, activity=activity_distributions[activity], @@ -132,12 +128,47 @@ def exposure_module_with_short_range(activity: str, ) return exposure_mc +def exposure_module_with_short_range_outdoors(activity: str, expiration: str, mask: str, sr_presence: list, sr_activities: list): + if mask == 'No mask': + exposure_mask = models.Mask.types['No mask'] + else: + exposure_mask = mask_distributions[mask] -def baseline_model(activity: str, - expiration: str, - mask: str, - sr_presence: list, - sr_activities: list): + exposure_mc = mc.ExposureModel( + concentration_model=mc.ConcentrationModel( + room=models.Room(volume=100000, humidity=0.5), + ventilation=models.AirChange( + active=models.SpecificInterval(((0, 24),)), + air_exch=1000000, + ), + infected=mc.InfectedPopulation( + number=1, + virus=virus_distributions['SARS_CoV_2_OMICRON'], + presence=mc.SpecificInterval(((8.5, 12.5),)), + mask=exposure_mask, + activity=activity_distributions[activity], + expiration=build_expiration(expiration), + host_immunity=0., + ), + ), + short_range=mc.ShortRangeModel( + presence=[models.SpecificInterval(interval) for interval in sr_presence], + expirations=[short_range_expiration_distributions[activity] for activity in sr_activities], + dilutions=dilution_factor(activities=sr_activities, + distance=np.random.uniform(0.5, 1.5, 250000)), + ), + exposed=mc.Population( + number=14, + presence=mc.SpecificInterval(((8.5, 12.5),)), + activity=activity_distributions[activity], + mask=exposure_mask, + host_immunity=0., + ), + ) + return exposure_mc + + +def baseline_model(activity: str, expiration: str, mask: str, sr_presence: list, sr_activities: list): if mask == 'No mask': exposure_mask = models.Mask.types['No mask'] else: @@ -152,7 +183,7 @@ def baseline_model(activity: str, ), infected=mc.InfectedPopulation( number=1, - virus=virus_distributions['SARS_CoV_2'], + virus=virus_distributions['SARS_CoV_2_OMICRON'], presence=models.SpecificInterval(((8.5, 12.5),)), mask=exposure_mask, activity=activity_distributions[activity], From 96800e04ffe70fc7248a5537b5234f964d7a4850 Mon Sep 17 00:00:00 2001 From: Andrejh Date: Mon, 21 Feb 2022 10:57:20 +0100 Subject: [PATCH 3/8] change to plot_vD_vs_exposure_time --- cara/short_range_plots/results.py | 69 ++++++++++++++++--------------- cara/short_range_plots/scripts.py | 26 +++++------- 2 files changed, 46 insertions(+), 49 deletions(-) diff --git a/cara/short_range_plots/results.py b/cara/short_range_plots/results.py index 658ab820..efb1be4b 100644 --- a/cara/short_range_plots/results.py +++ b/cara/short_range_plots/results.py @@ -20,41 +20,42 @@ from cara.monte_carlo.data import symptomatic_vl_frequencies # print('\n<<<<<<<<<<< Peak viral concentration with short range interactions for baseline scenarios >>>>>>>>>>>') # concentration_curve(models=[exposure_module_with_short_range( -# activity='Seated', -# expiration={"Speaking": 1, "Breathing": 2}, +# activity='Light activity', +# expiration={"Speaking": 1, "Breathing": 2}, # mask='No mask', -# sr_presence=[(10.5, 11.0), (15.5, 16.0)], -# sr_activities=['Breathing', 'Shouting']), +# sr_presence=[(10.5, 11.0), (15.0, 16.0)], +# sr_activities=['Breathing', 'Speaking']), # exposure_module_without_short_range( -# activity='Seated', -# expiration={"Speaking": 1, "Breathing": 2}, -# mask='No mask', -# )], -# labels = ['Mean concentration with short range interactions', 'Mean concentration without short range interactions'], -# colors = ['royalblue', 'darkviolet'], -# linestyles = ['-', '-'], -# thickness = [2, 2.5]) +# activity='Light activity', +# expiration={"Speaking": 1, "Breathing": 2}, +# mask='No mask',) +# ], +# labels = ['Concentration with short range interactions', 'Background (long-range) concentration'], +# labelsDose = ['Dose (full)', 'Dose (long-range)'], +# colors = ['salmon', 'royalblue'], +# linestyles = ['-', '--'], +# thickness = [2, 2]) -# print('\n<<<<<<<<<<< Probability of infections vs exposure time >>>>>>>>>>>') -# Always assume 1h for the short range interactions. -# Always assume that in each model there is only ONE short range interaction. -# plot_pi_vs_exposure_time(exp_models = [ -# baseline_model( -# activity='Seated', -# expiration={"Speaking": 2, "Breathing": 1}, -# mask='No mask', -# sr_presence=[(10.0, 11.0)], -# sr_activities=['Breathing']), -# baseline_model( -# activity='Seated', -# expiration={"Shouting": 2, "Breathing": 1}, -# mask='No mask', -# sr_presence=[(10.0, 11.0)], -# sr_activities=['Shouting'])], -# labels = ['Baseline model breathing', 'Baseline model shouting'], -# colors=['royalblue', 'darkviolet'], -# linestyles=['solid', 'solid'], -# points=20, -# time_in_minutes=True, -# normalize_y_axis=True) +print('\n<<<<<<<<<<< Dose vs SR exposure time >>>>>>>>>>>') +#Always assume 1h for the short range interactions. +#Always assume that in each model there is only ONE short range interaction. +plot_vD_vs_exposure_time(exp_models = [ + baseline_model( + activity='Light activity', + expiration={"Speaking": 2, "Breathing": 1}, + mask='No mask', + sr_presence=[(8.5, 9.5)], + sr_activities=['Breathing']), + baseline_model( + activity='Light activity', + expiration={"Speaking": 2, "Breathing": 1}, + mask='No mask', + sr_presence=[(8.5, 9.5)], + sr_activities=['Speaking'])], + labels = ['Baseline model breathing', 'Baseline model speaking'], + colors=['royalblue', 'darkviolet'], + linestyles=['solid', 'solid'], + points=20, + time_in_minutes=True, + normalize_y_axis=True) diff --git a/cara/short_range_plots/scripts.py b/cara/short_range_plots/scripts.py index 72a54441..3e537d3c 100644 --- a/cara/short_range_plots/scripts.py +++ b/cara/short_range_plots/scripts.py @@ -149,18 +149,14 @@ def concentration_curve(models, labels, labelsDose, colors, linestyles, thicknes plt.legend(handles=labels_legend, loc='upper left') plt.show() -def plot_pi_vs_exposure_time(exp_models: typing.List[mc.ExposureModel], - labels, - colors, - linestyles, - points: int = 20, time_in_minutes: bool = False, normalize_y_axis: bool = False) -> None: +def plot_vD_vs_exposure_time(exp_models: typing.List[mc.ExposureModel], labels, colors, linestyles, points: int = 20, time_in_minutes: bool = False, normalize_y_axis: bool = False) -> None: - TIMESTEP = 0.001 + TIMESTEP = 0.01 concentration_models = [model.concentration_model for model in exp_models] exposed_models = [model.exposed for model in exp_models] - pis: typing.List[typing.List[float]] = [[] for _ in exp_models] + vDs: typing.List[typing.List[float]] = [[] for _ in exp_models] presence_intervals = [model.short_range.presence[0].boundaries() for model in exp_models] start, final = presence_intervals[0] @@ -177,20 +173,20 @@ def plot_pi_vs_exposure_time(exp_models: typing.List[mc.ExposureModel], ) for cm, exposed, em in zip(concentration_models, exposed_models, exp_models)] for i, m in enumerate(current_models): - pis[i].append(np.mean(m.build_model(SAMPLE_SIZE).infection_probability() / 100)) + vDs[i].append(np.mean(m.build_model(SAMPLE_SIZE).deposited_exposure())) times = np.linspace(0, 60, points) - for i, pi in enumerate(pis): - plt.plot(times, pi, color=colors[i], label=labels[i]) + for i, vD in enumerate(vDs): + plt.plot(times, vD, color=colors[i], label=labels[i]) # plt.xlim((0, 60)) - if normalize_y_axis: - plt.ylim((0, 1)) + #if normalize_y_axis: + # plt.ylim((0, 1)) for m in exp_models: - print(np.mean(m.build_model(SAMPLE_SIZE).infection_probability() / 100)) + print(np.mean(m.build_model(SAMPLE_SIZE).deposited_exposure())) - plt.xlabel(f'Exposure time (m)', fontsize=12) - plt.ylabel('Probability of infection\n$P(\,\mathtt{I}\,)$', fontsize=12) + plt.xlabel(f'Duration of close-proximity encounter\n(min)', fontsize=12) + plt.ylabel('Mean cumulative dose\n(infectious virus)', fontsize=12) plt.legend() plt.show() From fb266e5a1be766407f8b72677da50b33004fbb49 Mon Sep 17 00:00:00 2001 From: Andrejh Date: Mon, 21 Feb 2022 10:57:33 +0100 Subject: [PATCH 4/8] change baseline model --- cara/short_range_plots/model_scenarios.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cara/short_range_plots/model_scenarios.py b/cara/short_range_plots/model_scenarios.py index 48d4476d..d90c75da 100644 --- a/cara/short_range_plots/model_scenarios.py +++ b/cara/short_range_plots/model_scenarios.py @@ -176,7 +176,7 @@ def baseline_model(activity: str, expiration: str, mask: str, sr_presence: list, exposure_mc = mc.ExposureModel( concentration_model=mc.ConcentrationModel( - room=models.Room(volume=10, humidity=0.5), + room=models.Room(volume=100, humidity=0.5), ventilation=models.AirChange( active=models.PeriodicInterval(period=120, duration=120), air_exch=0.25, @@ -184,7 +184,7 @@ def baseline_model(activity: str, expiration: str, mask: str, sr_presence: list, infected=mc.InfectedPopulation( number=1, virus=virus_distributions['SARS_CoV_2_OMICRON'], - presence=models.SpecificInterval(((8.5, 12.5),)), + presence=models.SpecificInterval(((8.5, 9.5),)), mask=exposure_mask, activity=activity_distributions[activity], expiration=build_expiration(expiration), @@ -199,7 +199,7 @@ def baseline_model(activity: str, expiration: str, mask: str, sr_presence: list, ), exposed=mc.Population( number=3, - presence=models.SpecificInterval(((8.5, 12.5),)), + presence=models.SpecificInterval(((8.5, 9.5),)), activity=activity_distributions[activity], mask=exposure_mask, host_immunity=0., From d76c7172cdc346766d31991c43139ccc525cdffb Mon Sep 17 00:00:00 2001 From: Andrejh Date: Mon, 21 Feb 2022 14:42:18 +0100 Subject: [PATCH 5/8] change to 500m3/h --- cara/short_range_plots/model_scenarios.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cara/short_range_plots/model_scenarios.py b/cara/short_range_plots/model_scenarios.py index d90c75da..dee31201 100644 --- a/cara/short_range_plots/model_scenarios.py +++ b/cara/short_range_plots/model_scenarios.py @@ -62,7 +62,7 @@ def exposure_module_without_short_range(activity: str, expiration: str, mask: st room=models.Room(volume=100, humidity=0.5), ventilation=models.AirChange( active=models.SpecificInterval(((0, 24),)), - air_exch=0.25, + air_exch=500/100, ), infected=mc.InfectedPopulation( number=1, @@ -100,7 +100,7 @@ def exposure_module_with_short_range(activity: str, expiration: str, mask: str, room=models.Room(volume=100, humidity=0.5), ventilation=models.AirChange( active=models.SpecificInterval(((0, 24),)), - air_exch=0.25, + air_exch=500/100, ), infected=mc.InfectedPopulation( number=1, From 4fa3d3b959bf48523e925781226b473b9091f21a Mon Sep 17 00:00:00 2001 From: Andrejh Date: Mon, 21 Feb 2022 14:43:06 +0100 Subject: [PATCH 6/8] add example with 1 SR interaction --- cara/short_range_plots/results.py | 71 ++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/cara/short_range_plots/results.py b/cara/short_range_plots/results.py index efb1be4b..56179dc2 100644 --- a/cara/short_range_plots/results.py +++ b/cara/short_range_plots/results.py @@ -13,10 +13,30 @@ from dataclasses import dataclass from cara.monte_carlo.data import symptomatic_vl_frequencies # print('\n<<<<<<<<<<< Peak viral concentration without short range for baseline scenarios >>>>>>>>>>>') -# concentration_curve(models = [exposure_module_without_short_range(activity='Seated', expiration='Breathing', mask='No mask')], -# labels = ['Baseline'], +# concentration_curve(models = [exposure_module_without_short_range(activity='Light activity', expiration={"Speaking": 1, "Breathing": 2}, mask='No mask')], +# labels = ['Background (long-range) concentration'], +# labelsDose = ['Dose (long-range)'], # colors = ['royalblue'], -# ) +# linestyles = ['--'], +# thickness = [2]) + +# print('\n<<<<<<<<<<< Peak viral concentration with short range interactions for baseline scenarios >>>>>>>>>>>') +# concentration_curve(models=[exposure_module_with_short_range( +# activity='Light activity', +# expiration={"Speaking": 1, "Breathing": 2}, +# mask='No mask', +# sr_presence=[(10.5, 11.0)], +# sr_activities=['Breathing']), +# exposure_module_without_short_range( +# activity='Light activity', +# expiration={"Speaking": 1, "Breathing": 2}, +# mask='No mask',) +# ], +# labels = ['Concentration with short range interactions', 'Background (long-range) concentration'], +# labelsDose = ['Dose (full)', 'Dose (long-range)'], +# colors = ['salmon', 'royalblue'], +# linestyles = ['-', '--'], +# thickness = [2, 2]) # print('\n<<<<<<<<<<< Peak viral concentration with short range interactions for baseline scenarios >>>>>>>>>>>') # concentration_curve(models=[exposure_module_with_short_range( @@ -36,26 +56,27 @@ from cara.monte_carlo.data import symptomatic_vl_frequencies # linestyles = ['-', '--'], # thickness = [2, 2]) -print('\n<<<<<<<<<<< Dose vs SR exposure time >>>>>>>>>>>') -#Always assume 1h for the short range interactions. -#Always assume that in each model there is only ONE short range interaction. -plot_vD_vs_exposure_time(exp_models = [ - baseline_model( - activity='Light activity', - expiration={"Speaking": 2, "Breathing": 1}, - mask='No mask', - sr_presence=[(8.5, 9.5)], - sr_activities=['Breathing']), - baseline_model( - activity='Light activity', - expiration={"Speaking": 2, "Breathing": 1}, - mask='No mask', - sr_presence=[(8.5, 9.5)], - sr_activities=['Speaking'])], - labels = ['Baseline model breathing', 'Baseline model speaking'], - colors=['royalblue', 'darkviolet'], - linestyles=['solid', 'solid'], - points=20, - time_in_minutes=True, - normalize_y_axis=True) + +# print('\n<<<<<<<<<<< Dose vs SR exposure time >>>>>>>>>>>') +# #Always assume 1h for the short range interactions. +# #Always assume that in each model there is only ONE short range interaction. +# plot_vD_vs_exposure_time(exp_models = [ +# baseline_model( +# activity='Light activity', +# expiration={"Speaking": 2, "Breathing": 1}, +# mask='No mask', +# sr_presence=[(8.5, 9.5)], +# sr_activities=['Breathing']), +# baseline_model( +# activity='Light activity', +# expiration={"Speaking": 2, "Breathing": 1}, +# mask='No mask', +# sr_presence=[(8.5, 9.5)], +# sr_activities=['Speaking'])], +# labels = ['Baseline model breathing', 'Baseline model speaking'], +# colors=['royalblue', 'darkviolet'], +# linestyles=['solid', 'solid'], +# points=20, +# time_in_minutes=True, +# normalize_y_axis=True) From f9e761edab2f0d739d31a4820e18acb536dc3421 Mon Sep 17 00:00:00 2001 From: Andrejh Date: Mon, 21 Feb 2022 14:43:20 +0100 Subject: [PATCH 7/8] timestep change --- cara/short_range_plots/scripts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cara/short_range_plots/scripts.py b/cara/short_range_plots/scripts.py index 3e537d3c..810ac13b 100644 --- a/cara/short_range_plots/scripts.py +++ b/cara/short_range_plots/scripts.py @@ -22,7 +22,7 @@ from mpl_toolkits.axes_grid1.inset_locator import mark_inset ######### Plot material ######### np.random.seed(2000) SAMPLE_SIZE = 250000 -TIMESTEP = 0.1 +TIMESTEP = 0.01 #viral_loads = np.linspace(2, 12, 600) _VectorisedFloat = typing.Union[float, np.ndarray] @@ -151,7 +151,7 @@ def concentration_curve(models, labels, labelsDose, colors, linestyles, thicknes def plot_vD_vs_exposure_time(exp_models: typing.List[mc.ExposureModel], labels, colors, linestyles, points: int = 20, time_in_minutes: bool = False, normalize_y_axis: bool = False) -> None: - TIMESTEP = 0.01 + TIMESTEP = 0.001 concentration_models = [model.concentration_model for model in exp_models] exposed_models = [model.exposed for model in exp_models] From 3acecd157326e427e246f2f1055613f756dcc02e Mon Sep 17 00:00:00 2001 From: "CERN\\Andrejh" Date: Tue, 22 Feb 2022 09:32:11 +0100 Subject: [PATCH 8/8] fix plot axis --- cara/short_range_plots/results.py | 44 +++++++++++++++---------------- cara/short_range_plots/scripts.py | 10 ++++--- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/cara/short_range_plots/results.py b/cara/short_range_plots/results.py index 56179dc2..955f7d8a 100644 --- a/cara/short_range_plots/results.py +++ b/cara/short_range_plots/results.py @@ -57,26 +57,26 @@ from cara.monte_carlo.data import symptomatic_vl_frequencies # thickness = [2, 2]) -# print('\n<<<<<<<<<<< Dose vs SR exposure time >>>>>>>>>>>') -# #Always assume 1h for the short range interactions. -# #Always assume that in each model there is only ONE short range interaction. -# plot_vD_vs_exposure_time(exp_models = [ -# baseline_model( -# activity='Light activity', -# expiration={"Speaking": 2, "Breathing": 1}, -# mask='No mask', -# sr_presence=[(8.5, 9.5)], -# sr_activities=['Breathing']), -# baseline_model( -# activity='Light activity', -# expiration={"Speaking": 2, "Breathing": 1}, -# mask='No mask', -# sr_presence=[(8.5, 9.5)], -# sr_activities=['Speaking'])], -# labels = ['Baseline model breathing', 'Baseline model speaking'], -# colors=['royalblue', 'darkviolet'], -# linestyles=['solid', 'solid'], -# points=20, -# time_in_minutes=True, -# normalize_y_axis=True) +print('\n<<<<<<<<<<< Dose vs SR exposure time >>>>>>>>>>>') +#Always assume 1h for the short range interactions. +#Always assume that in each model there is only ONE short range interaction. +plot_vD_vs_exposure_time(exp_models = [ + baseline_model( + activity='Light activity', + expiration={"Speaking": 2, "Breathing": 1}, + mask='No mask', + sr_presence=[(8.5, 9.5)], + sr_activities=['Breathing']), + baseline_model( + activity='Light activity', + expiration={"Speaking": 2, "Breathing": 1}, + mask='No mask', + sr_presence=[(8.5, 9.5)], + sr_activities=['Speaking'])], + labels = ['Breathing', 'Speaking'], + colors=['royalblue', 'darkviolet'], + linestyles=['solid', 'solid'], + points=20, + time_in_minutes=True, + normalize_y_axis=True) diff --git a/cara/short_range_plots/scripts.py b/cara/short_range_plots/scripts.py index 810ac13b..e6f7d6de 100644 --- a/cara/short_range_plots/scripts.py +++ b/cara/short_range_plots/scripts.py @@ -73,12 +73,13 @@ def concentration_curve(models, labels, labelsDose, colors, linestyles, thicknes concentrations = [[np.mean(model.concentration( t)) for t in times] for model in tqdm(exp_models)] - fig, ax = plt.subplots() + fig, ax = plt.subplots(figsize=(8,6)) for c, color, linestyle, width in zip(concentrations, colors, linestyles, thickness): ax.plot(times, c, color=color, ls=linestyle, lw=width) - ax.set_ylim(ax.get_ylim()[0], ax.get_ylim()[1] * 1.2) + #ax.set_ylim(ax.get_ylim()[0], ax.get_ylim()[1] * 1.2) + ax.set_ylim(ax.get_ylim()[0], 90) ax.spines["right"].set_visible(False) cumulative_doses = [np.cumsum([ @@ -130,7 +131,8 @@ def concentration_curve(models, labels, labelsDose, colors, linestyles, thicknes ax1.spines["right"].set_linestyle((0, (1, 5))) ax1.set_ylabel('Mean cumulative dose\n(infectious virus)', fontsize=14) - ax1.set_ylim(ax1.get_ylim()[0], ax1.get_ylim()[1] * 1.3) + #ax1.set_ylim(ax1.get_ylim()[0], ax1.get_ylim()[1] * 1.3) + ax1.set_ylim(ax1.get_ylim()[0], 40) complete_labels = labels + [label for label in labelsDose] complete_colors = colors + [color for color in colors] @@ -186,7 +188,7 @@ def plot_vD_vs_exposure_time(exp_models: typing.List[mc.ExposureModel], labels, for m in exp_models: print(np.mean(m.build_model(SAMPLE_SIZE).deposited_exposure())) - plt.xlabel(f'Duration of close-proximity encounter\n(min)', fontsize=12) + plt.xlabel(f'Duration of close-proximity encounter (min)', fontsize=12) plt.ylabel('Mean cumulative dose\n(infectious virus)', fontsize=12) plt.legend() plt.show()