From 175baaaca23d3e58bbeaef183b1ee3e6344badec Mon Sep 17 00:00:00 2001 From: DepFA <35278260+dfaker@users.noreply.github.com> Date: Mon, 26 Sep 2022 14:46:18 +0100 Subject: [PATCH] xy_grid - Show blank cells when grid is incomplete --- scripts/xy_grid.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py index 3a2e103f..279af6b7 100644 --- a/scripts/xy_grid.py +++ b/scripts/xy_grid.py @@ -2,6 +2,7 @@ from collections import namedtuple from copy import copy import random +from PIL import Image import numpy as np import modules.scripts as scripts @@ -108,7 +109,10 @@ def draw_xy_grid(p, xs, ys, x_labels, y_labels, cell, draw_legend): if first_pocessed is None: first_pocessed = processed - res.append(processed.images[0]) + try: + res.append(processed.images[0]) + except: + res.append(Image.new(res[0].mode, res[0].size)) grid = images.image_grid(res, rows=len(ys)) if draw_legend: