From c54767d572d25078d4961b66a2c0db29f46f3f10 Mon Sep 17 00:00:00 2001 From: markus Date: Tue, 2 Mar 2021 16:42:05 +0100 Subject: [PATCH] use pastels for legend --- cara/montecarlo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cara/montecarlo.py b/cara/montecarlo.py index 4ab93ea9..d4df48f6 100644 --- a/cara/montecarlo.py +++ b/cara/montecarlo.py @@ -1176,7 +1176,7 @@ def compare_viruses_qr(violins: bool = True) -> None: ax.set_xticklabels(['SARS-CoV-2', 'SARS-CoV', 'Influenza', 'Measles', 'Tuberculosis']) ax.hlines(y=[np.log10(970)], linestyles=['dashed'], colors=['red'], xmin=0, xmax=4) - handles = [patches.Patch(color=c, label=l) for c, l in zip(pastels, ('Breathing', 'Speaking', 'Shouting'))] + handles = [patches.Patch(color=c, label=l) for c, l in zip([p + (0.3,) for p in pastels], ('Breathing', 'Speaking', 'Shouting'))] handles += [mlines.Line2D([], [], linestyle='dashed', color='red', label='Chorale')] plt.legend(handles=handles, loc='lower left', bbox_to_anchor=(0.2, 0.03)) ax.set_yticks([i for i in range(-6, 7, 2)])