From 667010784da89eaeee012cc5dc5d3f363d3d6617 Mon Sep 17 00:00:00 2001 From: Katharina Buchthal Date: Mon, 13 May 2024 14:07:03 +0200 Subject: [PATCH] fixed bug in plots --- kinfraglib/filters/plots.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kinfraglib/filters/plots.py b/kinfraglib/filters/plots.py index 25a1aebd..57ef99db 100644 --- a/kinfraglib/filters/plots.py +++ b/kinfraglib/filters/plots.py @@ -53,14 +53,16 @@ def make_hists( # create one plot for each subpocket for i in range(0, 2): for j in range(0, int((num_plots) / 2)): - if (i * 4) + j < num_plots: + if (i * 4) + j <= num_plots and subpocket_num < len( + fragment_library.keys() + ): ax = plt.subplot(gs[i, j]) ax.hist( fragment_library[keys[subpocket_num]][colname], facecolor="#04D8B2", edgecolor="#808080", ) - ax.set_title(keys[((i * 4) + j)]) + ax.set_title(keys[subpocket_num]) if ( plot_stats ): # add statistics box (max, min, mean value per subpocket)