From 6a7a472e24e3f65ba8d390041d8a2c51a30aaa23 Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Wed, 4 Nov 2020 16:05:08 +0000
Subject: [PATCH] Merge branch 'fix/1d3d-embedded-convergence-test' into
 'master'

[test][fixup][embedded][1d3d] Do not create plot before importing matplotlib

See merge request dumux-repositories/dumux!2346

(cherry picked from commit 8f3601ab164ba7b35c3e2992fb6990cc4b8dfba2)

b557b23f [test][fixup][embedded][1d3d] Do not create plot before importing matplotlib
---
 test/multidomain/embedded/1d3d/1p_1p/convergence.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/multidomain/embedded/1d3d/1p_1p/convergence.py b/test/multidomain/embedded/1d3d/1p_1p/convergence.py
index e0172e0b11..6dd40b6dfa 100755
--- a/test/multidomain/embedded/1d3d/1p_1p/convergence.py
+++ b/test/multidomain/embedded/1d3d/1p_1p/convergence.py
@@ -59,8 +59,6 @@ table1 = [["", "", "", "", "", "", ""] for i in range(len(cells)+1)]
 table2 = [["", "", "", "", "", "", ""] for i in range(len(cells)+1)]
 table3 = [["", "", "", "", "", "", ""] for i in range(len(cells)+1)]
 
-dpi = 300.0
-fig, axes = plt.subplots(1, 3, dpi=dpi, figsize=(8, 4))
 for exec, result in res.items():
     p3d = []
     p1d = []
@@ -140,10 +138,14 @@ for exec, result in res.items():
 try:
     import matplotlib
     import matplotlib.pyplot as plt
+
     plt.style.use('ggplot')
     font = {'family': 'sans-serif', 'weight': 'normal', 'size': 8}
     matplotlib.rc('font', **font)
 
+    dpi = 300.0
+    fig, axes = plt.subplots(1, 3, dpi=dpi, figsize=(8, 4))
+
     x = np.linspace(np.min(hR), np.max(hR), 10)
     axes[0].plot(x, np.power(x*radius*0.4, 1.5), "--k", label=r"$\Delta$ 1.5")
     axes[0].plot(x, np.power(x*radius*0.3, 2), "-.k", label=r"$\Delta$ 2")
-- 
GitLab