Merge remote-tracking branch 'origin/feature/mc' into feature/mc
This commit is contained in:
commit
d4a48da49a
1 changed files with 9 additions and 9 deletions
|
|
@ -558,9 +558,9 @@ def plot_pi_vs_viral_load(baselines: typing.Union[MCExposureModel, typing.List[M
|
|||
plt.fill_between(viral_loads, lower_percentiles, upper_percentiles, alpha=0.2)
|
||||
|
||||
plt.title(title)
|
||||
plt.ylabel('Probability of infection (%)\n$P(I|qID=60)$')
|
||||
plt.ylabel('Probability of infection (%)', fontsize=14)
|
||||
plt.xticks(ticks=[i for i in range(3, 13)], labels=['$10^{' + str(i) + '}$' for i in range(3, 13)])
|
||||
plt.xlabel('Viral load (RNA copies mL$^{-1}$)\n$vl$')
|
||||
plt.xlabel('Viral load (RNA copies mL$^{-1}$)', fontsize=14)
|
||||
# add vertical lines for the critical viral loads for which pi= 5 or 95
|
||||
|
||||
if len(baselines) == 1:
|
||||
|
|
@ -579,8 +579,8 @@ def plot_pi_vs_viral_load(baselines: typing.Union[MCExposureModel, typing.List[M
|
|||
|
||||
plt.vlines(x=(left, right), ymin=0, ymax=1,
|
||||
colors=('grey', 'grey'), linestyles='dotted')
|
||||
plt.text(left - 1.1, 0.80, '$vl_{0.05}$', fontsize=12,color='black')
|
||||
plt.text(right + 0.1, 0.80, '$vl_{0.95}$', fontsize=12,color='black')
|
||||
plt.text(left - 1.1, 0.80, '$vl_{0.05}$', fontsize=14,color='black')
|
||||
plt.text(right + 0.1, 0.80, '$vl_{0.95}$', fontsize=14,color='black')
|
||||
# add 3 shaded areas
|
||||
plt.axvspan(3, left, alpha=0.1, color='limegreen')
|
||||
plt.axvspan(left, right, alpha=0.1, color='orange')
|
||||
|
|
@ -687,9 +687,9 @@ def composite_plot_pi_vs_viral_load(baselines: typing.List[MCExposureModel], lab
|
|||
axs[1, 0].set_xticks([i for i in range(2, 13, 2)])
|
||||
axs[1, 0].set_xticklabels(['$10^{' + str(i) + '}$' for i in range(2, 13, 2)])
|
||||
axs[1, 0].set_xlim(2, 12)
|
||||
axs[1, 0].set_xlabel('Viral load (RNA copies mL$^{-1}$)\n$vl$')
|
||||
axs[0, 0].set_ylabel('Probability of infection (%)\n$P(I|qID=60)$')
|
||||
plt.suptitle(title)
|
||||
axs[1, 0].set_xlabel('Viral load (RNA copies mL$^{-1}$)', fontsize=12)
|
||||
axs[0, 0].set_ylabel('Probability of infection (%)\n$P(I|qID=60)$', fontsize=12)
|
||||
plt.suptitle(title, fontsize=12)
|
||||
|
||||
axs[0, 0].text(11, -0.01, '$(i)$')
|
||||
axs[1, 0].text(11, axs[1, 0].get_ylim()[1] * 0.8, '$(ii)$')
|
||||
|
|
@ -704,12 +704,12 @@ def composite_plot_pi_vs_viral_load(baselines: typing.List[MCExposureModel], lab
|
|||
break
|
||||
|
||||
for i, (crit, color) in enumerate(zip(crits, colors)):
|
||||
axs[0, 0].text(2.5, 0.4 - i * 0.1, f'x $vl_{"{0.95}"}=' + '10^{' + str(np.round(crits[i], 1)) + '}$', fontsize=10, color=color)
|
||||
axs[0, 0].text(2.5, 0.45 - i * 0.1, f'x $vl_{"{0.95}"}=' + '10^{' + str(np.round(crits[i], 1)) + '}$', fontsize=10, color=color)
|
||||
axs[0, 0].plot(crits[i], 0.95, 'x', color=color)
|
||||
|
||||
if show_lines:
|
||||
axs[0, 0].hlines([0.5], colors=['lightgrey'], linestyles=['dashed'], xmin=2, xmax=12)
|
||||
axs[0, 0].text(9.7, 0.52, "$P(I) = 0.5$", color='lightgrey')
|
||||
axs[0, 0].text(9.7, 0.52, "$P(I) = 0.5$", color='grey')
|
||||
middle_positions = []
|
||||
for line in lines:
|
||||
for i, point in enumerate(line):
|
||||
|
|
|
|||
Loading…
Reference in a new issue