diff --git a/cara/montecarlo.py b/cara/montecarlo.py index 706df204..e85b1283 100644 --- a/cara/montecarlo.py +++ b/cara/montecarlo.py @@ -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')