From 137ee5517ac2bd62aeb7d3f4d51a12fba5501cd6 Mon Sep 17 00:00:00 2001
From: Claudio Zandonella <claudiozandonella@gmail.com>
Date: Sun, 23 Apr 2023 15:51:24 +0200
Subject: [PATCH] fix quarto plots

---
 justclust/quarto.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/justclust/quarto.py b/justclust/quarto.py
index b020f19..5892384 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],
-- 
GitLab