diff --git a/justclust/quarto.py b/justclust/quarto.py index b020f19abdb0a5c8804b83039ea39fd2a54b3121..589238401a7dde4730d50fbd97ae8ab4957dc2e8 100644 --- a/justclust/quarto.py +++ b/justclust/quarto.py @@ -1310,9 +1310,15 @@ def plot_cluster_comp_loop( figsize=(4 * 3, 4.5 * nrows), ) for c, cl in enumerate(data_plot.columns): + + irow = floor(c / ncols) icol = floor(c - (irow * ncols)) - ax = axes[irow][icol] + + if len(data_plot.columns) <= ncols: + ax = axes[icol] + else: + ax = axes[irow][icol] plot_cluster_comp( serie_plot = data_plot[cl],