From 2abc0d223af46d6c0d7191dae84d006620a187a9 Mon Sep 17 00:00:00 2001
From: Dennis Noll <dennis.noll@rwth-aachen.de>
Date: Fri, 14 Aug 2020 11:12:01 +0200
Subject: [PATCH] [plotting] Multiplot: fixed edgecase

---
 plotting.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/plotting.py b/plotting.py
index a8f9bca..53a9ccf 100644
--- a/plotting.py
+++ b/plotting.py
@@ -28,7 +28,12 @@ class Multiplot:
     def index(self, i):
         row = int(i / self.cols)
         col = i - row * self.cols
-        return row, col
+        if self.rows == 1:
+            return col
+        if self.cols == 1:
+            return row
+        else:
+            return row, col
 
 
 def saveplot(f):
-- 
GitLab