From db2bea460179b4031b37afdb6b635c9f58753548 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Riette?= <sebastien.riette@meteo.fr>
Date: Tue, 17 Jan 2023 08:59:29 +0100
Subject: [PATCH] S. Riette 17 Jan 2022: update comp_DDH for numerous plots

---
 tools/comp_DDH.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/comp_DDH.py b/tools/comp_DDH.py
index fd36158a6..1d9f06238 100755
--- a/tools/comp_DDH.py
+++ b/tools/comp_DDH.py
@@ -46,8 +46,10 @@ def comp_DDH(filename1, filename2, output_fig, tol_ad=3E-7, tol_rd=1.E-6, verbos
     toplt = [fid for fid in toplt if fid is not None]
     pb_val = len(toplt) > 0
     if pb_val:
-        figure, ax = plt.subplots(ncols=len(toplt), figsize=(5 * len(toplt), 10), squeeze=False)
-        ax = ax[0, :]
+        ncols, nrows = min(10, len(toplt)), 1+(len(toplt)-1)//10
+        figure, ax = plt.subplots(ncols=ncols, nrows=nrows,
+                                  figsize=(5 * ncols, 10 * nrows), squeeze=False)
+        ax = ax.flatten()
         figure.suptitle(filename1 + ' ' + filename2)
         for ifid, fid in enumerate(toplt):
             v1 = r1.readfield(fid)
-- 
GitLab