make arrow position scale with samples

This commit is contained in:
markus 2021-02-08 13:35:01 +01:00
parent 6f4bb006df
commit 18c24ff063

View file

@ -451,13 +451,13 @@ def present_model(model: MCConcentrationModel, bins: int = 200) -> None:
f'{categories[model.infected.breathing_category - 1]}')
axs[1, 0].set_xlabel('Breathing rate [$m^3\;h^{-1}$]')
top = axs[1, 1].get_ylim()[1]
axs[1, 1].set_title('Quantum generation rate')
axs[1, 1].set_xlabel('qR [log10($q\;h^{-1}$)]')
# TODO: Set height to highest bar
mean, std = np.mean(qRs), np.std(qRs)
axs[1, 1].annotate('', xy=(mean + std, 2000), xytext=(np.max(qRs), 2000),
axs[1, 1].annotate('', xy=(mean + std, top - 250), xytext=(np.max(qRs), top - 250),
arrowprops={'arrowstyle': '<|-|>', 'ls': 'dashed'})
axs[1, 1].text(mean + std + 0.1, 2100, 'Superspreader', fontsize=8)
axs[1, 1].text(mean + std + 0.1, top - 150, 'Superspreader', fontsize=8)
mean_patch = patches.Patch(color='grey', label='Mean')
median_patch = patches.Patch(color='black', label='Median')